diff options
author | jcid <devnull@localhost> | 2008-10-14 17:08:05 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2008-10-14 17:08:05 +0200 |
commit | 8c44bd9dde63cf35d6e3f9b3fd50d6aa2abeaf27 (patch) | |
tree | bd92dc226b15589b377ff3caca35dca11a0a8c66 /src/IO | |
parent | ac69e7d06d94360bb4907fc4a6e1665745ed8e05 (diff) |
- Used the URL authority part instead of stripped default port in HTTP query.
Diffstat (limited to 'src/IO')
-rw-r--r-- | src/IO/http.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/IO/http.c b/src/IO/http.c index 03bb4522..30ec059f 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -197,15 +197,10 @@ Dstr *Http_make_content_type(const DilloUrl *url) Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) { char *ptr, *cookies, *referer; - Dstr *s_port = dStr_new(""), - *query = dStr_new(""), + Dstr *query = dStr_new(""), *full_path = dStr_new(""), *proxy_auth = dStr_new(""); - /* Sending the default port in the query may cause a 302-answer. --Jcid */ - if (URL_PORT(url) && URL_PORT(url) != DILLO_URL_HTTP_PORT) - dStr_sprintfa(s_port, ":%d", URL_PORT(url)); - if (use_proxy) { dStr_sprintfa(full_path, "%s%s", URL_STR(url), @@ -233,7 +228,7 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) "Connection: close\r\n" "Accept-Charset: utf-8,*;q=0.8\r\n" "Accept-Encoding: gzip\r\n" - "Host: %s%s\r\n" + "Host: %s\r\n" "%s" "%s" "User-Agent: Dillo/%s\r\n" @@ -241,7 +236,7 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) "Content-Type: %s\r\n" "%s" "\r\n", - full_path->str, URL_HOST(url), s_port->str, + full_path->str, URL_AUTHORITY(url), proxy_auth->str, referer, VERSION, URL_DATA(url)->len, content_type->str, cookies); @@ -255,7 +250,7 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) "Connection: close\r\n" "Accept-Charset: utf-8,*;q=0.8\r\n" "Accept-Encoding: gzip\r\n" - "Host: %s%s\r\n" + "Host: %s\r\n" "%s" "%s" "User-Agent: Dillo/%s\r\n" @@ -264,13 +259,12 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) full_path->str, (URL_FLAGS(url) & URL_E2EQuery) ? "Cache-Control: no-cache\r\nPragma: no-cache\r\n" : "", - URL_HOST(url), s_port->str, + URL_AUTHORITY(url), proxy_auth->str, referer, VERSION, cookies); } dFree(referer); dFree(cookies); - dStr_free(s_port, TRUE); dStr_free(full_path, TRUE); dStr_free(proxy_auth, TRUE); _MSG("Query: {%s}\n", dStr_printable(query, 8192)); |