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

Resgate may stop on HTTP requests #57

Closed
jirenius opened this issue Dec 19, 2018 · 0 comments
Closed

Resgate may stop on HTTP requests #57

jirenius opened this issue Dec 19, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@jirenius
Copy link
Collaborator

jirenius commented Dec 19, 2018

Issue

If HTTP requests are sent with URL:s that are translated into invalid NATS subjects, NATS will disconnect Resgate, which in turn responds by stopping.

Most common is using trailing slash:

/api/service/model/

Which translates into the invalid subject:

service.model.

Solution

Tighten up the validation on URL's to only allow paths that translates to valid NATS subjects.

At the same time, to avoid http.ServerMux's MovedPermanently redirects caused by other invalid URLS, such as /api/server//model, the ServerMux should be replaced with a custom handler.

@jirenius jirenius added the bug Something isn't working label Dec 19, 2018
@jirenius jirenius changed the title Resgate may stops on HTTP requests Resgate may stop on HTTP requests Dec 19, 2018
jirenius added a commit that referenced this issue Dec 19, 2018
…'s no longer redirect, but gives 404 error instead.

Added tests for config.go
jirenius added a commit that referenced this issue Dec 19, 2018
…= 33 and <= 126. Tightened up validation on call/auth method names.
jirenius added a commit that referenced this issue Dec 19, 2018
jirenius added a commit that referenced this issue Dec 19, 2018
…n-http-requests

Feature/gh 57 resgate may stop on http requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant