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 http path bug #16117

Merged
merged 5 commits into from Jun 9, 2021
Merged

Fix http path bug #16117

merged 5 commits into from Jun 9, 2021

Conversation

lunny
Copy link
Member

@lunny lunny commented Jun 9, 2021

Added some tests

@lunny lunny added the type/bug label Jun 9, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jun 9, 2021
@6543 6543 added this to the 1.15.0 milestone Jun 9, 2021
@KN4CK3R
Copy link
Member

KN4CK3R commented Jun 9, 2021

Could you add a test for a existing file with the name test..txt which should work?
And maybe a different method name like containsParentDirectorySeparator because test..txt contains "dot dot" but the method would return false.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 9, 2021
@6543 6543 merged commit da05799 into go-gitea:main Jun 9, 2021
@lunny lunny deleted the lunny/fix_http_path branch June 9, 2021 13:00
6543 added a commit to 6543-forks/gitea that referenced this pull request Jun 9, 2021
* Fix http path bug

* Add missed request

* add tests

Co-authored-by: 6543 <6543@obermui.de>
@6543 6543 mentioned this pull request Jun 9, 2021
@6543 6543 added the backport/done All backports for this PR have been created label Jun 9, 2021
@6543
Copy link
Member

6543 commented Jun 9, 2021

-> #16120

6543 added a commit that referenced this pull request Jun 9, 2021
* Fix http path bug

* Add missed request

* add tests

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@zeripath
Copy link
Contributor

zeripath commented Jun 9, 2021

path.Clean("/" + filepath.ToSlash(pth))[1:] would have been simpler.

@lunny
Copy link
Member Author

lunny commented Jun 9, 2021

So should we support /username/reponame/objects/info/a\b\c?

@zeripath
Copy link
Contributor

zeripath commented Jun 9, 2021

I don't think it really matters on linux - such refs would be invalid refs by git's standards so they'd return 404 in any case.

AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 10, 2021
* Fix http path bug

* Add missed request

* add tests

Co-authored-by: 6543 <6543@obermui.de>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants