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

Raw file API: don't try to interpret 40char filenames as commit SHA (#17185) #17272

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

noerw
Copy link
Member

@noerw noerw commented Oct 8, 2021

This is a stripped down backport of #17185, fixes #17179.

Don't try to interpret treepath as commit hash when path contains no hash-path-separator ('/')

Entering this case when path does not contain a '/' doesn't really
make sense, as that means the tree path is empty, but this case is only
entered for routes that expect a non-empty tree path.

Treepaths like <40-char-filename> will now work, while paths like <40-char-dirname>/<filename> will still fail,
but hopefully don't occur that often. A more complete fix that avoids
this case too is outlined in #17185, but is too big of a change to functionality to backport

...when path contains no hash-path-separator ('/')

This is a workaround to go-gitea#17179.

Entering this case when `path` does not contain a '/' does not really
make sense, as that means the tree path is empty, but this case is only
entered for routes that expect a non-empty tree path.

Treepaths like <40-char-dirname>/<filename> will still fail,
but hopefully don't occur that often. A more complete fix that avoids
this case too is outlined in go-gitea#17185, but too big of a change to backport
@noerw noerw added modifies/api This PR adds API routes or modifies them type/bug labels Oct 8, 2021
@noerw noerw added this to the 1.15.4 milestone Oct 8, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Oct 8, 2021
@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 Oct 8, 2021
@techknowlogick techknowlogick merged commit 245596e into go-gitea:release/v1.15 Oct 8, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants