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

checkPathAgainstBase with basePath '/' #27

Open
tsu1980 opened this issue Sep 22, 2023 · 2 comments
Open

checkPathAgainstBase with basePath '/' #27

tsu1980 opened this issue Sep 22, 2023 · 2 comments

Comments

@tsu1980
Copy link

tsu1980 commented Sep 22, 2023

Thanks your great job.

I found problem when Server path is no base path like this.

servers:
  - url: 'http://127.0.0.1/'

This will call checkPathAgainstBase with basePath '/'. And the checkPathAgainstBase trim basePath last slash here, but if basePath is '/', basePaths is to be empty string. It's unexpected behavior, right?

so I think the code should be fixed like this.

		if len(basePaths[i]) > 1 && basePaths[i][len(basePaths[i])-1] == '/' {
			basePaths[i] = basePaths[i][:len(basePaths[i])-1]
		}
@daveshanley
Copy link
Member

Would you be able to contribute this code yourself? This is a fully open source project and only thrives when the community feeds back into it. I can make the change, but it's your discovery and you should get the recognition for it.

@emilien-puget
Copy link
Contributor

can you check with the latest version v0.0.47 ?

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

3 participants