Skip to content

Commit

Permalink
Temporarily disable location header normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas11 committed Aug 29, 2024
1 parent 21058dc commit ff8d746
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
22 changes: 11 additions & 11 deletions provider/pkg/azure/client_azcore.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,17 @@ func normalizeLocationHeader(host, apiVersion string, headers http.Header) {
return
}

if !locUrl.IsAbs() {
locUrl.Host = host
absUrlStr := runtime.JoinPaths(host, locUrlStr)
absUrl, err := url.Parse(absUrlStr)
if err != nil {
logging.V(3).Infof("Location header '%s' is not an absolute URL, failed to make absolute: %s", locUrlStr, absUrlStr)
} else {
locUrl = absUrl
logging.V(9).Infof("Location header '%s' is not an absolute URL, added host '%s'", locUrlStr, host)
}
}
// if !locUrl.IsAbs() {
// locUrl.Host = host
// absUrlStr := runtime.JoinPaths(host, locUrlStr)
// absUrl, err := url.Parse(absUrlStr)
// if err != nil {
// logging.V(3).Infof("Location header '%s' is not an absolute URL, failed to make absolute: %s", locUrlStr, absUrlStr)
// } else {
// locUrl = absUrl
// logging.V(9).Infof("Location header '%s' is not an absolute URL, added host '%s'", locUrlStr, host)
// }
// }

if locUrl.Query().Get("api-version") == "" {
q := locUrl.Query()
Expand Down
1 change: 1 addition & 0 deletions provider/pkg/azure/client_azcore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

func TestNormalizeLocationHeader(t *testing.T) {
t.Skip("TODO,tkappler")
const host = "https://management.azure.com"
const apiVersion = "2022-09-01"

Expand Down

0 comments on commit ff8d746

Please sign in to comment.