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

NewRouter for servers section throw exception if no path is specified #407

Closed
NaerChang2 opened this issue Aug 15, 2021 · 1 comment
Closed

Comments

@NaerChang2
Copy link
Contributor

Following servers section is causing exception because URL.EscapedPath() returns empty and index access is missing length check.

servers:
  - url: https://example.com

So it's causing line 46 to throw out of index exception.

if path[len(path)-1] == '/' {
	...
}

For better user experience a simple len(path) check will be nice.

@NaerChang2
Copy link
Contributor Author

PR: #408

@fenollp fenollp closed this as completed Aug 16, 2021
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

No branches or pull requests

2 participants