sunaku / dasht

💁 Search API docs offline, in terminal or browser
https://sunaku.github.io/dasht/man
823 stars 26 forks source link

Fix dasht-server-http serving "400 Bad Request" on requests for "/" #54

Closed Tenzer closed 3 years ago

Tenzer commented 3 years ago

This was reported in sunaku/dasht#51. It's not clear to me if this only affects macOS users.

The problem was the grep query changed here doesn't match queries for "/":

~ $ cat urls
/
/?
/?query
/foo
/bar
~ $ cat urls | grep '^/$\|^/?'
/?
/?query

The two patterns to match for are fairly simple, so they can instead be tested for with simple string equality checks.

sunaku commented 3 years ago

Looks good upon visual inspection. I'll test and merge soon. Thanks! :bow:

sunaku commented 3 years ago

LOL :joy: Turns out we already discussed this implementation in issue #51 --- it's been so long that I've forgotten. :sweat_smile: Merged. :shipit:

Tenzer commented 3 years ago

Indeed, thanks for merging :)