Skip to content

Commit

Permalink
Merge pull request #1154 from jhiemstrawisc/issue-1110
Browse files Browse the repository at this point in the history
Don't include scheme when setting XRDHOST for osdf origins
  • Loading branch information
turetske authored Apr 24, 2024
2 parents 8ea0ecc + 6505ffb commit 726da48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions xrootd/xrootd_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,8 @@ func ConfigXrootd(ctx context.Context, origin bool) (string, error) {
return "", errors.Wrapf(err, "Failed to parse external web URL: %s", externalWebUrl)
}

// Strip the port number from the URL
externalWebUrl.Host = externalWebUrl.Hostname()
if err := os.Setenv("XRDHOST", externalWebUrl.String()); err != nil {
// Strip the scheme and port number from the URL and use to set XRDHOST
if err := os.Setenv("XRDHOST", externalWebUrl.Hostname()); err != nil {
return "", err
}
}
Expand Down
4 changes: 2 additions & 2 deletions xrootd/xrootd_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func TestXrootDOriginConfig(t *testing.T) {
configPath, err := ConfigXrootd(ctx, true)
require.NoError(t, err)
assert.NotNil(t, configPath)
assert.Equal(t, "https://my-xrootd.com", os.Getenv("XRDHOST"))
assert.Equal(t, "my-xrootd.com", os.Getenv("XRDHOST"))

viper.Reset()
})
Expand All @@ -273,7 +273,7 @@ func TestXrootDOriginConfig(t *testing.T) {
configPath, err := ConfigXrootd(ctx, true)
require.NoError(t, err)
assert.NotNil(t, configPath)
assert.Equal(t, "https://my-xrootd.com", os.Getenv("XRDHOST"))
assert.Equal(t, "my-xrootd.com", os.Getenv("XRDHOST"))

viper.Reset()
})
Expand Down

0 comments on commit 726da48

Please sign in to comment.