mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:26:06 +00:00
win: Pass a query component, if present, to an HTTP server
BUG=crashpad:163 Change-Id: I046dcef56a788ae04848383b0601e35d172c8183 Reviewed-on: https://chromium-review.googlesource.com/447916 Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
parent
ded751da3d
commit
1dcd45ab75
@ -136,6 +136,16 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) {
|
|||||||
std::wstring extra_info(url_components.lpszExtraInfo,
|
std::wstring extra_info(url_components.lpszExtraInfo,
|
||||||
url_components.dwExtraInfoLength);
|
url_components.dwExtraInfoLength);
|
||||||
|
|
||||||
|
// Use url_path, and get the query parameter from extra_info, up to the first
|
||||||
|
// #, if any. See RFC 7230 §5.3.1 and RFC 3986 §3.4. Beware that when this is
|
||||||
|
// used to POST data, the query parameters generally belong in the request
|
||||||
|
// body and not in the URL request target. It’s legal for them to be in both
|
||||||
|
// places, but the interpretation is subject to whatever the client and server
|
||||||
|
// agree on. This honors whatever was passed in, matching other platforms, but
|
||||||
|
// you’ve been warned!
|
||||||
|
std::wstring request_target(
|
||||||
|
url_path.append(extra_info.substr(0, extra_info.find(L'#'))));
|
||||||
|
|
||||||
ScopedHINTERNET connect(WinHttpConnect(
|
ScopedHINTERNET connect(WinHttpConnect(
|
||||||
session.get(), host_name.c_str(), url_components.nPort, 0));
|
session.get(), host_name.c_str(), url_components.nPort, 0));
|
||||||
if (!connect.get()) {
|
if (!connect.get()) {
|
||||||
@ -146,7 +156,7 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) {
|
|||||||
ScopedHINTERNET request(WinHttpOpenRequest(
|
ScopedHINTERNET request(WinHttpOpenRequest(
|
||||||
connect.get(),
|
connect.get(),
|
||||||
base::UTF8ToUTF16(method()).c_str(),
|
base::UTF8ToUTF16(method()).c_str(),
|
||||||
url_path.c_str(),
|
request_target.c_str(),
|
||||||
nullptr,
|
nullptr,
|
||||||
WINHTTP_NO_REFERER,
|
WINHTTP_NO_REFERER,
|
||||||
WINHTTP_DEFAULT_ACCEPT_TYPES,
|
WINHTTP_DEFAULT_ACCEPT_TYPES,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user