Skip to content

Commit

Permalink
RestBackend: remove adding context to query
Browse files Browse the repository at this point in the history
This part of the code was broken and adding the topic string again as a
context query parameter, which was confusing to the user as well as the
client implementations.

Signed-off-by: Alexander Krimm <[email protected]>
  • Loading branch information
wirew0rm authored and RalphSteinhagen committed Nov 13, 2024
1 parent 42044c3 commit e3cb6f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/majordomo/include/majordomo/RestBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,7 @@ struct RestBackend<Mode, VirtualFS, Roles...>::RestWorker {
bool respondWithLongPollRedirect(const httplib::Request &request, httplib::Response &response, const mdp::Topic &subscription, detail::PollingIndex redirectLongPollingIdx) {
auto uri = URI<>::factory()
.path(request.path)
.addQueryParameter("LongPollingIdx", std::to_string(redirectLongPollingIdx))
.addQueryParameter("SubscriptionContext", subscription.toMdpTopic().str());
.addQueryParameter("LongPollingIdx", std::to_string(redirectLongPollingIdx));

// copy over the original query parameters
addParameters(request, uri);
Expand Down
2 changes: 1 addition & 1 deletion src/majordomo/test/majordomoworker_rest_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ std::jthread makeLongPollingRequestResponseCheckerThread(const std::string &addr
const std::string url = fmt::format("{}{}LongPollingIdx={}", address, address.contains('?') ? "&" : "?", i == 0 ? "Next" : fmt::format("{}", i));
const auto response = http.Get(url);
if (i == 0) { // check forwarding to the explicit index
REQUIRE(response->location.find("&LongPollingIdx=0") != std::string::npos);
REQUIRE(response->location.find("LongPollingIdx=0") != std::string::npos);
}
requireWithSource(response);
const auto requiredStatusCode = i < requiredStatusCodes.size() ? requiredStatusCodes[i] : 200;
Expand Down

0 comments on commit e3cb6f9

Please sign in to comment.