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

Conversation

@techknowlogick
Copy link
Member

techknowlogick commented Jan 31, 2019

As title

@codecov-io

This comment has been minimized.

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.

@lunny

This comment has been minimized.

Copy link
Member

lunny commented Jan 31, 2019

Why change that to false?

@zeripath

This comment has been minimized.

Copy link
Contributor

zeripath commented Jan 31, 2019

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 and removed lgtm/need 2 labels Jan 31, 2019

@lafriks

This comment has been minimized.

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

@lunny

lunny approved these changes Jan 31, 2019

@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Jan 31, 2019

@lunny lunny added the kind/breaking label Jan 31, 2019

@lunny

This comment has been minimized.

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

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details

@techknowlogick techknowlogick deleted the techknowlogick:techknowlogick-patch-14 branch Jan 31, 2019

techknowlogick added a commit to techknowlogick/gitea that referenced this pull request Jan 31, 2019

techknowlogick added a commit that referenced this pull request Jan 31, 2019

@lafriks

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

techknowlogick commented Jan 31, 2019

@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

This comment has been minimized.

Copy link
Member

lafriks commented Jan 31, 2019

That's shity :D

@techknowlogick

This comment has been minimized.

Copy link
Member Author

techknowlogick commented Jan 31, 2019

@lafriks 😂 yup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment