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

Disable redirect for i18n #5910

Merged
merged 2 commits into from
Jan 31, 2019
Merged

Disable redirect for i18n #5910

merged 2 commits into from
Jan 31, 2019

Conversation

techknowlogick
Copy link
Member

As title

@techknowlogick techknowlogick added type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality. backport/v1.7 labels Jan 31, 2019
@techknowlogick techknowlogick added this to the 1.8.0 milestone Jan 31, 2019
@codecov-io
Copy link

codecov-io commented Jan 31, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@98feb0e). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5910   +/-   ##
=========================================
  Coverage          ?   37.97%           
=========================================
  Files             ?      329           
  Lines             ?    48405           
  Branches          ?        0           
=========================================
  Hits              ?    18382           
  Misses            ?    27383           
  Partials          ?     2640
Impacted Files Coverage Δ
routers/routes/routes.go 85.12% <100%> (ø)

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 98feb0e...6adb4f3. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 31, 2019
@lunny
Copy link
Member

lunny commented Jan 31, 2019

Why change that to false?

@zeripath
Copy link
Contributor

So there's another option, which would mitigate other similar issues in future of sticking a handler before the the il8n handler which does a path.Clean() and redirects to the clean path if the path wasn't clean to begin with.

However this does solve the current problem, and it's not as if the lang query parameter can be used elsewhere - so I'm gonna approve.

@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 Jan 31, 2019
@lafriks
Copy link
Member

lafriks commented Jan 31, 2019

I don't think this is correct solution, we should do fix to upstream lib or move that middleware to gitea code

@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 Jan 31, 2019
@lunny lunny added the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Jan 31, 2019
@lunny
Copy link
Member

lunny commented Jan 31, 2019

@lafriks I think this is a temporary PR so that is able to be back port to release/v1.7

@techknowlogick techknowlogick merged commit 3a73069 into go-gitea:master Jan 31, 2019
@techknowlogick techknowlogick deleted the techknowlogick-patch-14 branch January 31, 2019 14:38
@lafriks
Copy link
Member

lafriks commented Jan 31, 2019

But this does not fix problem completely, problem that currently is solved could be solved also keeping redirect by changing few lines up AppSubURL to AppURL

@techknowlogick
Copy link
Member Author

@lafriks that doesn't entirely work, as i18n library uses AppSubURL to set cookie path

Set-Cookie: lang=fr-FR; Path=/http://localhost:3000; Max-Age=2147483647

@lafriks
Copy link
Member

lafriks commented Jan 31, 2019

That's shity :D

@techknowlogick
Copy link
Member Author

@lafriks 😂 yup.

@lafriks lafriks added the topic/security Something leaks user information or is otherwise vulnerable. Should be fixed! label Jan 31, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! topic/security Something leaks user information or is otherwise vulnerable. Should be fixed! type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants