Skip to content

Commit

Permalink
Merge pull request #368 from fyb007/master
Browse files Browse the repository at this point in the history
FIX HttpRequest does'nt contain ip:port causing httpclient profile without http://ip:port
  • Loading branch information
zxy0728 authored Aug 10, 2018
2 parents 7a4024c + dc34a3c commit b9a6beb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ else if (args.length == 5) {
RequestLine rl = hr.getRequestLine();
httpAction = rl.getMethod();
targetURL = rl.getUri();

// 部分HttpRequest中没有ip:port,需要从httpHost中拿到再拼接
if (!targetURL.startsWith("http")) {
targetURL = requestProducer.getTarget().toURI() + targetURL;
}
}
catch (IOException e) {
// ignore thie exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ public void doStart(Object[] args) {
httpAction = rl.getMethod();
targetURl = rl.getUri();

// 部分HttpRequest中没有ip:port,需要从httpHost中拿到再拼接
if (!targetURl.startsWith("http")) {
targetURl = target.toURI() + targetURl;
}

Map<String, Object> params = new HashMap<String, Object>();

params.put(CaptureConstants.INFO_CLIENT_REQUEST_URL, targetURl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ public void doStart(Object[] args) {
try {
httpAction = method.getName();
targetURL = method.getURI().toString();

// HttpMethod中可能不包含ip:port,需要从httpHost中拿到再拼接
if (!targetURL.startsWith("http")) {
targetURL = hostconfig.getHostURL() + targetURL;
}
}
catch (URIException e) {
// ignore
Expand Down

0 comments on commit b9a6beb

Please sign in to comment.