-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Refactor and simplify redirect to url #3674
Refactor and simplify redirect to url #3674
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3674 +/- ##
==========================================
- Coverage 35.87% 35.87% -0.01%
==========================================
Files 287 287
Lines 41362 41359 -3
==========================================
- Hits 14840 14837 -3
+ Misses 24336 24334 -2
- Partials 2186 2188 +2
Continue to review full report at Codecov.
|
} | ||
|
||
u, err := url.Parse(loc) | ||
if err != nil || (u.Scheme != "" && !strings.HasPrefix(strings.ToLower(loc), strings.ToLower(setting.AppURL))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably break someones setup, but it's slightly more secure 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would it break?
Refactor and simplify redirect to url, also improve checking url for errors