diff options
author | Uli Heilmeier <uh@heilmeier.eu> | 2016-02-25 15:00:18 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-02-26 13:16:28 +0000 |
commit | 10358a2f14a69fbbf0e3042429399e4934a79674 (patch) | |
tree | 28d474db9fe074aed1ef2978480b8b0515467942 /epan | |
parent | 7bd6bae799a46381cd572e46f0a7b9979fd0b6eb (diff) |
HTTP: Fix full_uri when using a Proxy
When the HTTP request is transmitted to a Proxy the URI is already
a "full URI".
Bug was reported by Thomas Baudelet.
Bug: 12176
Change-Id: I83f6bdef6fa96233792c6bbe54caad38df0f5fb6
Reviewed-on: https://code.wireshark.org/review/14142
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-http.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 5bd023117f..b7261eb8e4 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -1082,9 +1082,16 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item *e_ti; gchar *uri; - uri = wmem_strdup_printf(wmem_packet_scope(), "%s://%s%s", - is_ssl ? "https" : "http", - g_strstrip(wmem_strdup(wmem_packet_scope(), stat_info->http_host)), stat_info->request_uri); + if ((g_ascii_strncasecmp(stat_info->request_uri, "http://", 7) == 0) || + (g_ascii_strncasecmp(stat_info->request_uri, "https://", 8) == 0) || + (g_ascii_strncasecmp(conv_data->request_method, "CONNECT", 7) == 0)) { + uri = wmem_strdup(wmem_packet_scope(), stat_info->request_uri); + } + else { + uri = wmem_strdup_printf(wmem_packet_scope(), "%s://%s%s", + is_ssl ? "https" : "http", + g_strstrip(wmem_strdup(wmem_packet_scope(), stat_info->http_host)), stat_info->request_uri); + } e_ti = proto_tree_add_string(http_tree, hf_http_request_full_uri, tvb, 0, |