Skip to content
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

fix: apply API.HTTPHeaders to /webui redirect #9733

Merged
merged 1 commit into from
Mar 17, 2023
Merged

fix: apply API.HTTPHeaders to /webui redirect #9733

merged 1 commit into from
Mar 17, 2023

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Mar 17, 2023

Closes #9728.

@hacdias hacdias requested a review from whizzzkid March 17, 2023 12:22
@hacdias hacdias self-assigned this Mar 17, 2023
@hacdias hacdias requested a review from lidel as a code owner March 17, 2023 12:22
@hacdias hacdias changed the title fix: add API HTTPHeaders to Web UI redirect fix: apply API.HTTPHeaders to Web UI redirect Mar 17, 2023
@hacdias hacdias changed the title fix: apply API.HTTPHeaders to Web UI redirect fix: apply API.HTTPHeaders to /webui redirect Mar 17, 2023
@hacdias hacdias requested a review from guseggert March 17, 2023 12:36
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks sensible

@hacdias hacdias merged commit 63b2a0e into master Mar 17, 2023
@hacdias hacdias deleted the issues/9728 branch March 17, 2023 14:14
}

func (i *redirectHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
for k, v := range i.headers {
w.Header()[k] = v
Copy link
Member

@lidel lidel Mar 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this: i dod not confirm it, but iiuc this shortcut may cause bugs if user passed header name using different capitalization that used elsewhere.

@hacdias do you mind swapping this to use dedicated funcs on Header type? (like Header.Set) instead? This will make headers work no matter what notation was used by user. There is similar snippet in ./core/corehttp/gateway_writable.go that also needs to be fixed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Missing Access-Control-Allow-Origin Headers on Redirects
2 participants