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 bug in reverse proxy #16026

Merged

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented May 30, 2021

Unfortunately go panics you try to cast a nil interface{} as another primitive
therefore you need to check interfaces are not nil before casting.

Regression from #15304

Fix #16025

Signed-off-by: Andrew Thornton art27@cantab.net

@zeripath zeripath added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels May 30, 2021
@zeripath zeripath added this to the 1.15.0 milestone May 30, 2021
@zeripath zeripath force-pushed the fix-16025-super-check-against-nil branch from f7ffa15 to 9e3904a Compare May 30, 2021 09:26
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2021

Codecov Report

Merging #16026 (bc553b3) into main (36dce0e) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16026      +/-   ##
==========================================
- Coverage   44.10%   44.08%   -0.02%     
==========================================
  Files         682      682              
  Lines       82375    82375              
==========================================
- Hits        36328    36313      -15     
- Misses      40140    40153      +13     
- Partials     5907     5909       +2     
Impacted Files Coverage Δ
modules/auth/sso/reverseproxy.go 8.51% <0.00%> (ø)
modules/charset/charset.go 71.71% <0.00%> (-6.07%) ⬇️
modules/queue/queue_bytefifo.go 75.14% <0.00%> (-3.56%) ⬇️
modules/git/repo_base_nogogit.go 82.85% <0.00%> (-2.86%) ⬇️
modules/git/utils.go 62.50% <0.00%> (-2.78%) ⬇️
modules/git/command.go 87.96% <0.00%> (-1.86%) ⬇️
services/gitdiff/gitdiff.go 72.35% <0.00%> (-1.42%) ⬇️
modules/log/file.go 75.39% <0.00%> (+1.58%) ⬆️
services/pull/patch.go 55.93% <0.00%> (+1.69%) ⬆️
services/pull/check.go 28.76% <0.00%> (+2.73%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 518ed50...bc553b3. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 30, 2021
Unfortunately go panics you try to cast a nil interface{} as another primitive
therefore you need to check interfaces are not nil before casting.

Fix go-gitea#16025

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath force-pushed the fix-16025-super-check-against-nil branch from 9e3904a to 89dd44e Compare May 30, 2021 12:12
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 30, 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 May 31, 2021
@techknowlogick techknowlogick merged commit 256b1a3 into go-gitea:main May 31, 2021
@zeripath zeripath deleted the fix-16025-super-check-against-nil branch May 31, 2021 07:11
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 10, 2021
Unfortunately go panics you try to cast a nil interface{} as another primitive
therefore you need to check interfaces are not nil before casting.

Fix go-gitea#16025

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@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
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reverse Proxy Authentication Without Session Causing Internal Server Error
6 participants