Skip to content

Commit

Permalink
switch url encode
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Apr 2, 2024
1 parent 8932343 commit f7eab77
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/aws-cpp-sdk-core/source/http/HttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,16 @@ namespace Aws
port << ":" << uri.GetPort();
}

// Note: GetURLEncodedPathRFC3986 does legacy mode by default, which
// leaves some reserved delimeter characters unencoded (things like
// = or , in RFC 3986 parlance). This mode can be adjusted using
// flag to use a modern GetURLEncodedPath encoding approach (i.e.
// encode everything except for a couple of known safe chars). In
// practice however CRT will never support legacy mode and will
// always need modern encoding, so be explicit here about which mode
// we use.
ss << SchemeMapper::ToString(uri.GetScheme()) << SEPARATOR << uri.GetAuthority() << port.str()
<< ((uri.GetPath() == "/") ? "" : uri.GetURLEncodedPathRFC3986())
<< ((uri.GetPath() == "/") ? "" : uri.GetURLEncodedPath())
<< uri.GetQueryString();

request->SetPath(Aws::Crt::ByteCursorFromCString(ss.str().c_str()));
Expand Down

0 comments on commit f7eab77

Please sign in to comment.