mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
fetch with HTTP/1.1
This commit is contained in:
parent
1e87aedbb8
commit
42075e74ad
@ -349,7 +349,7 @@ namespace client
|
|||||||
if (leaseSet)
|
if (leaseSet)
|
||||||
{
|
{
|
||||||
std::stringstream request, response;
|
std::stringstream request, response;
|
||||||
request << "GET " << u.path_ << " HTTP/1.0\r\nHost: " << u.host_
|
request << "GET " << u.path_ << " HTTP/1.1\r\nHost: " << u.host_
|
||||||
<< "\r\nAccept: */*\r\n" << "User-Agent: Wget/1.11.4\r\n" << "Connection: close\r\n\r\n";
|
<< "\r\nAccept: */*\r\n" << "User-Agent: Wget/1.11.4\r\n" << "Connection: close\r\n\r\n";
|
||||||
|
|
||||||
auto stream = i2p::client::context.GetSharedLocalDestination ()->CreateStream (*leaseSet, u.port_);
|
auto stream = i2p::client::context.GetSharedLocalDestination ()->CreateStream (*leaseSet, u.port_);
|
||||||
|
@ -485,17 +485,17 @@ namespace util
|
|||||||
{
|
{
|
||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
case 105: buffers.push_back(boost::asio::buffer("HTTP/1.0 105 Name Not Resolved\r\n")); break;
|
case 105: buffers.push_back(boost::asio::buffer("HTTP/1.1 105 Name Not Resolved\r\n")); break;
|
||||||
case 200: buffers.push_back(boost::asio::buffer("HTTP/1.0 200 OK\r\n")); break;
|
case 200: buffers.push_back(boost::asio::buffer("HTTP/1.1 200 OK\r\n")); break;
|
||||||
case 400: buffers.push_back(boost::asio::buffer("HTTP/1.0 400 Bad Request\r\n")); break;
|
case 400: buffers.push_back(boost::asio::buffer("HTTP/1.1 400 Bad Request\r\n")); break;
|
||||||
case 404: buffers.push_back(boost::asio::buffer("HTTP/1.0 404 Not Found\r\n")); break;
|
case 404: buffers.push_back(boost::asio::buffer("HTTP/1.1 404 Not Found\r\n")); break;
|
||||||
case 408: buffers.push_back(boost::asio::buffer("HTTP/1.0 408 Request Timeout\r\n")); break;
|
case 408: buffers.push_back(boost::asio::buffer("HTTP/1.1 408 Request Timeout\r\n")); break;
|
||||||
case 500: buffers.push_back(boost::asio::buffer("HTTP/1.0 500 Internal Server Error\r\n")); break;
|
case 500: buffers.push_back(boost::asio::buffer("HTTP/1.1 500 Internal Server Error\r\n")); break;
|
||||||
case 502: buffers.push_back(boost::asio::buffer("HTTP/1.0 502 Bad Gateway\r\n")); break;
|
case 502: buffers.push_back(boost::asio::buffer("HTTP/1.1 502 Bad Gateway\r\n")); break;
|
||||||
case 503: buffers.push_back(boost::asio::buffer("HTTP/1.0 503 Not Implemented\r\n")); break;
|
case 503: buffers.push_back(boost::asio::buffer("HTTP/1.1 503 Not Implemented\r\n")); break;
|
||||||
case 504: buffers.push_back(boost::asio::buffer("HTTP/1.0 504 Gateway Timeout\r\n")); break;
|
case 504: buffers.push_back(boost::asio::buffer("HTTP/1.1 504 Gateway Timeout\r\n")); break;
|
||||||
default:
|
default:
|
||||||
buffers.push_back(boost::asio::buffer("HTTP/1.0 200 OK\r\n"));
|
buffers.push_back(boost::asio::buffer("HTTP/1.1 200 OK\r\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::size_t i = 0; i < headers.size(); ++i)
|
for (std::size_t i = 0; i < headers.size(); ++i)
|
||||||
|
4
util.cpp
4
util.cpp
@ -239,7 +239,7 @@ namespace http
|
|||||||
if (site)
|
if (site)
|
||||||
{
|
{
|
||||||
// User-Agent is needed to get the server list routerInfo files.
|
// User-Agent is needed to get the server list routerInfo files.
|
||||||
site << "GET " << u.path_ << " HTTP/1.0\r\nHost: " << u.host_
|
site << "GET " << u.path_ << " HTTP/1.1\r\nHost: " << u.host_
|
||||||
<< "\r\nAccept: */*\r\n" << "User-Agent: Wget/1.11.4\r\n" << "Connection: close\r\n\r\n";
|
<< "\r\nAccept: */*\r\n" << "User-Agent: Wget/1.11.4\r\n" << "Connection: close\r\n\r\n";
|
||||||
// read response
|
// read response
|
||||||
std::string version, statusMessage;
|
std::string version, statusMessage;
|
||||||
@ -291,7 +291,7 @@ namespace http
|
|||||||
{
|
{
|
||||||
i2p::util::http::url u(address);
|
i2p::util::http::url u(address);
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "GET " << address << " HTTP/1.0" << std::endl;
|
ss << "GET " << address << " HTTP/1.1" << std::endl;
|
||||||
ss << "Host: " << u.host_ << std::endl;
|
ss << "Host: " << u.host_ << std::endl;
|
||||||
ss << "Accept: */*" << std::endl;
|
ss << "Accept: */*" << std::endl;
|
||||||
ss << "User - Agent: Wget / 1.11.4" << std::endl;
|
ss << "User - Agent: Wget / 1.11.4" << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user