Skip to content

Commit

Permalink
RestClientEmscripten: Preserve query parameters for sub/unsub
Browse files Browse the repository at this point in the history
Make sure LongPollingIdx is appended to existing query params, not
replacing them.
  • Loading branch information
frankosterfeld authored and RalphSteinhagen committed Feb 6, 2024
1 parent 9e244e5 commit a7a7c5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/include/RestClientEmscripten.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class RestClient : public ClientBase {
}

void startSubscription(Command &&cmd) {
auto uri = opencmw::URI<>::factory(cmd.topic).queryParam("LongPollingIdx=Next").build();
auto uri = opencmw::URI<>::factory(cmd.topic).addQueryParameter("LongPollingIdx", "Next").build();
cmd.topic = uri;

auto payload = std::make_unique<detail::SubscriptionPayload>(std::move(cmd), _mimeType);
Expand All @@ -288,7 +288,7 @@ class RestClient : public ClientBase {
// void get(...)
// void set(...)
// instead of going through a fake generic request(...)?
auto uri = opencmw::URI<>::factory(cmd.topic).queryParam("LongPollingIdx=Next").build();
auto uri = opencmw::URI<>::factory(cmd.topic).addQueryParameter("LongPollingIdx", "Next").build();
auto payloadIt = std::find_if(detail::subscriptionPayloads.begin(), detail::subscriptionPayloads.end(),
[&](const auto &ptr) {
return ptr->command.topic == uri;
Expand Down

0 comments on commit a7a7c5c

Please sign in to comment.