-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Clarify the suffices and prefixes of setting.AppSubURL and setting.AppURL #12999
Clarify the suffices and prefixes of setting.AppSubURL and setting.AppURL #12999
Conversation
…pURL Also removes some unnecessary uses of fmt.Sprintf and adds documentation strings Signed-off-by: Andrew Thornton <art27@cantab.net>
|
Codecov Report
@@ Coverage Diff @@
## master #12999 +/- ##
==========================================
- Coverage 42.59% 42.59% -0.01%
==========================================
Files 671 671
Lines 73625 73619 -6
==========================================
- Hits 31363 31357 -6
+ Misses 37183 37181 -2
- Partials 5079 5081 +2
Continue to review full report at Codecov.
|
Imho both appurl and appsuburl should end with |
The reason that AppSubURL doesn't have a terminal / is because it allows it to be empty when there is no suburl. That's quite nice actually and leads to very compact relative URLs and easy handling of AppSubURL with relative addresses. (Just prefix them with AppSubURL and it will always be right.) AppURL will have a terminal slash for other similar reasons in that some proxies will likely only proxy the slash terminal address and I suspect that means that it's easier to and simpler to just write AppURL instead of AppURL+"/" This PRs intention was not change behaviour but rather to clarify what is actually happenin, but if we were to change anything I'd argue we should not have the terminal / on the AppURL. That would make creating the "relpath" and making the absolute URL the same: clean the path to root it on the AppSubURL then either prefix with suburl or the URL as appropriate. |
I would prefer that non of them should have |
AppURL has to contain the AppSubURL so I think you mean |
yes, I meant |
As a (partially relevant) aside: Do you know if there is ever a reason for Gitea to be producing non-FQDN urls that point outside of its own root? My suspicion is that there is not and that there should not be. |
I don't know what did you mean by that but there should not be such urls |
…s-defined-as-having-no-trailing-slash
Codecov Report
@@ Coverage Diff @@
## master #12999 +/- ##
==========================================
+ Coverage 41.96% 42.24% +0.28%
==========================================
Files 683 683
Lines 75279 75375 +96
==========================================
+ Hits 31589 31843 +254
+ Misses 38524 38306 -218
- Partials 5166 5226 +60
Continue to review full report at Codecov.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
@uli-heller would you like to test now ? |
🚀 |
In more than a couple of places we're slightly confused about whether AppURL and AppSubURL have preceding or trailing slashes.
This PR adds comments to the definition of the setting.App*, removes an old unused setting variable, uses the clarity obtained to simplify several uses of AppURL and AppSubURL and fixes a potential issue with a missing QuoteMeta in regexp.
Signed-off-by: Andrew Thornton art27@cantab.net