File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func TestGuessCurrentHostURL(t *testing.T) {
5050
5151 assert .Equal (t , "http://cfg-host" , GuessCurrentHostURL (t .Context ()))
5252
53- // legacy: the "Host" is not used when there is no "X-Forwarded-Proto" header
53+ // legacy: "Host" is not used when there is no "X-Forwarded-Proto" header
5454 ctx := context .WithValue (t .Context (), RequestContextKey , & http.Request {Host : "req-host:3000" })
5555 assert .Equal (t , "http://cfg-host" , GuessCurrentHostURL (ctx ))
5656
Original file line number Diff line number Diff line change 5252 // It maps to ini:"ROOT_URL"
5353 AppURL string
5454
55- // PublicURLGeneration controls how to use the HTTP request headers to generate public URL
56- PublicURLGeneration string
55+ // PublicURLDetection controls how to use the HTTP request headers to detect public URL
56+ PublicURLDetection string
5757
5858 // AppSubURL represents the sub-url mounting point for gitea, parsed from "ROOT_URL"
5959 // It is either "" or starts with '/' and ends without '/', such as '/{sub-path}'.
@@ -289,9 +289,9 @@ func loadServerFrom(rootCfg ConfigProvider) {
289289
290290 defaultAppURL := string (Protocol ) + "://" + Domain + ":" + HTTPPort
291291 AppURL = sec .Key ("ROOT_URL" ).MustString (defaultAppURL )
292- PublicURLGeneration = sec .Key ("PUBLIC_URL_DETECTION" ).MustString (PublicURLLegacy )
293- if PublicURLGeneration != PublicURLAuto && PublicURLGeneration != PublicURLLegacy {
294- log .Fatal ("Invalid PUBLIC_URL_DETECTION value: %s" , PublicURLGeneration )
292+ PublicURLDetection = sec .Key ("PUBLIC_URL_DETECTION" ).MustString (PublicURLLegacy )
293+ if PublicURLDetection != PublicURLAuto && PublicURLDetection != PublicURLLegacy {
294+ log .Fatal ("Invalid PUBLIC_URL_DETECTION value: %s" , PublicURLDetection )
295295 }
296296
297297 // Check validity of AppURL
You can’t perform that action at this time.
0 commit comments