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

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

Merged
merged 1 commit into from
Feb 7, 2021
Merged

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

merged 1 commit into from
Feb 7, 2021

Conversation

Tenzer
Copy link
Contributor

@Tenzer Tenzer commented Nov 20, 2020

This was reported in #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.

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

The problem was the `grep` query changed in this commit 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
Copy link
Owner

sunaku commented Feb 7, 2021

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

@sunaku sunaku merged commit eb5e50a into sunaku:master Feb 7, 2021
@sunaku
Copy link
Owner

sunaku commented Feb 7, 2021

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

@Tenzer
Copy link
Contributor Author

Tenzer commented Feb 7, 2021

Indeed, thanks for merging :)

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.

2 participants