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

Text input with leading slash can cause unexpected 400 errors #1584

Open
orangejulius opened this issue Nov 19, 2021 · 0 comments
Open

Text input with leading slash can cause unexpected 400 errors #1584

orangejulius opened this issue Nov 19, 2021 · 0 comments
Labels

Comments

@orangejulius
Copy link
Member

orangejulius commented Nov 19, 2021

An interesting report came in today, some short autocomplete queries return an unexpected 400 error with a leading slash (/).

Some examples that are broken:

/v1/autocomplete?text=/cali
/v1/autocomplete?text=/colo
/v1/autocomplete?text=/brook

Some examples that work:

/v1/autocomplete?text=/broo
/v1/autocomplete?text=/asdf

In all broken cases, the parsed_text.subject property is just the slash:

"query": {
      "text": "/brook",
      "parser": "pelias",
      "parsed_text": {
        "subject": "/",
        "locality": "brook",
        "admin": "brook"
      },

It looks like whether or not the input was parsed as a subject will determine if this bug manifests or not, but maybe we want to fix it elsewhere, like by removing leading slashes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant