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

Suggest-URL with query params break search #246

Open
sb-relaxt-at opened this issue Jun 13, 2023 · 0 comments
Open

Suggest-URL with query params break search #246

sb-relaxt-at opened this issue Jun 13, 2023 · 0 comments

Comments

@sb-relaxt-at
Copy link

If the suggest url contains query parameters ("…/suggest?foo=bar") this will break the search. The parsed fetchURL will have the query params populated into the properties query as well as search. The update to include the search term manipulates query, but the search property remains unchanged. As documented "query … will only be used if search is absent."

const fetchURL = url.parse(optionUrl, true);
fetchURL.query.term = input;
return fetch(url.format(fetchURL), { credentials: 'same-origin' })

It seems to be sufficient to delete/unset search (directly updating search is more difficult as it is not parsed into an object):

fetchURL.search = undefined;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants