Merge branch 'webrequest-fix-param'
Fix URL parameters handling in WinHTTP wxWebView backend. See https://github.com/wxWidgets/wxWidgets/pull/2264
This commit is contained in:
@@ -330,7 +330,7 @@ void wxWebRequestWinHTTP::Start()
|
|||||||
|
|
||||||
wxString objectName(urlComps.lpszUrlPath, urlComps.dwUrlPathLength);
|
wxString objectName(urlComps.lpszUrlPath, urlComps.dwUrlPathLength);
|
||||||
if ( urlComps.dwExtraInfoLength )
|
if ( urlComps.dwExtraInfoLength )
|
||||||
objectName += "?" + wxString(urlComps.lpszExtraInfo, urlComps.dwExtraInfoLength);
|
objectName += wxString(urlComps.lpszExtraInfo, urlComps.dwExtraInfoLength);
|
||||||
|
|
||||||
// Open a request
|
// Open a request
|
||||||
static const wchar_t* acceptedTypes[] = { L"*/*", NULL };
|
static const wchar_t* acceptedTypes[] = { L"*/*", NULL };
|
||||||
|
@@ -212,6 +212,21 @@ TEST_CASE_METHOD(RequestFixture,
|
|||||||
CHECK( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" );
|
CHECK( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE_METHOD(RequestFixture,
|
||||||
|
"WebRequest::Get::Param", "[net][webrequest][get]")
|
||||||
|
{
|
||||||
|
if ( !InitBaseURL() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Create("/get?pi=3.14159265358979323");
|
||||||
|
Run();
|
||||||
|
|
||||||
|
// We ought to really parse the returned JSON object, but to keep things as
|
||||||
|
// simple as possible for now we just treat it as a string.
|
||||||
|
CHECK_THAT( request.GetResponse().AsString().ToStdString(),
|
||||||
|
Catch::Contains("\"pi\": \"3.14159265358979323\"") );
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE_METHOD(RequestFixture,
|
TEST_CASE_METHOD(RequestFixture,
|
||||||
"WebRequest::Get::File", "[net][webrequest][get]")
|
"WebRequest::Get::File", "[net][webrequest][get]")
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user