Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapic: Fix multistream target URL ? handling #1300

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

victorges
Copy link
Member

It turns out that Mist has a special parsing of these push URLs which is not a regular URL parsing. It removes anything after the last ? in the URL and uses that as its config. If there are multiple ? in the URL (e.g. query-string already existed in target URL), it will strip only (from) the last one and keep the previous.

So instead of merging Mist's qs with the existing ones, we actually need to create a separate ? section for Mist. This guarantees both that Mist gets its config properly, as well as that it preserves the URL to call the target service.

@thomshutt
Copy link
Contributor

Could you add some unit tests to make this easier to reason about please?

It turns out that Mist has a special parsing of these push URLs which
is not a regular URL parsing. It removes anything after the last `?`
in the URL and uses that as its config. If there are multiple `?` in
the URL (e.g. query-string already existed in target URL), it will
strip only (from) the last one and keep the previous.

So instead of merging Mist's qs with the existing ones, we actually
need to create a separate `?` section for Mist. This guarantees both
that Mist gets its config properly, as well as that it preserves the
URL to call the target service.
@gioelecerati gioelecerati force-pushed the vg/fix/multistream-question-mark branch from 776a77f to 803a4fc Compare September 4, 2024 14:30
Copy link
Member Author

@victorges victorges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gioelecerati gioelecerati merged commit b4097be into main Sep 5, 2024
11 checks passed
@gioelecerati gioelecerati deleted the vg/fix/multistream-question-mark branch September 5, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants