Skip to content

Commit

Permalink
[wpinet] HttpRequest: Keep params ordered (wpilibsuite#7246)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson authored Oct 22, 2024
1 parent 7cc7fa1 commit e8d2d1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wpinet/src/main/native/include/wpinet/HttpUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ class HttpRequest {
template <typename T>
HttpRequest(const HttpLocation& loc, const T& extraParams)
: host{loc.host}, port{loc.port} {
StringMap<std::string_view> params;
SmallVector<std::pair<std::string_view, std::string_view>, 4> params;
for (const auto& p : loc.params) {
params.insert(std::make_pair(GetFirst(p), GetSecond(p)));
params.emplace_back(std::make_pair(GetFirst(p), GetSecond(p)));
}
for (const auto& p : extraParams) {
params.insert(std::make_pair(GetFirst(p), GetSecond(p)));
params.emplace_back(std::make_pair(GetFirst(p), GetSecond(p)));
}
SetPath(loc.path, params);
SetAuth(loc);
Expand Down

0 comments on commit e8d2d1c

Please sign in to comment.