mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: Http improvements
git-svn-id: svn://ultimatepp.org/upp/trunk@4777 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
738979d878
commit
c7167f9044
2 changed files with 378 additions and 382 deletions
|
|
@ -346,12 +346,12 @@ void HttpRequest::StartRequest()
|
|||
data << Nvl(path, "/");
|
||||
data << " HTTP/1.1\r\n";
|
||||
if(std_headers) {
|
||||
data << "URL: " << url << "\r\n"
|
||||
data// << "URL: " << url << "\r\n"
|
||||
<< "Host: " << host_port << "\r\n"
|
||||
<< "Connection: close\r\n"
|
||||
<< "Accept: " << Nvl(accept, "*/*") << "\r\n"
|
||||
<< "Accept-Encoding: gzip\r\n"
|
||||
<< "Agent: " << Nvl(agent, "Ultimate++ HTTP client") << "\r\n";
|
||||
<< "User-Agent: " << Nvl(agent, "Ultimate++ HTTP client") << "\r\n";
|
||||
if(postdata.GetCount())
|
||||
data << "Content-Length: " << postdata.GetCount() << "\r\n";
|
||||
if(ctype.GetCount())
|
||||
|
|
@ -431,10 +431,6 @@ void HttpRequest::ReadingChunkHeader()
|
|||
String HttpRequest::GetRedirectUrl()
|
||||
{
|
||||
String redirect_url = TrimLeft(header["location"]);
|
||||
int q = redirect_url.Find('?');
|
||||
int p = path.Find('?');
|
||||
if(p >= 0 && q < 0)
|
||||
redirect_url.Cat(path.Mid(p));
|
||||
if(redirect_url.StartsWith("http://") || redirect_url.StartsWith("https://"))
|
||||
return redirect_url;
|
||||
String h = (ssl ? "https://" : "http://") + host;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue