Skip to content

Suggest-URL with query params break search #246

@sb-relaxt-at

Description

@sb-relaxt-at

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;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions