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

[BUGS-5914] Send the header to the result and not the server #237

Merged

Conversation

srtfisher
Copy link
Contributor

@srtfisher srtfisher commented Jul 11, 2023

Instead of sending the header to the server, attach the header to the response.

This fixes an issue when rest_preload_api_request() is used to preload a REST API request. This causes a Cannot modify header information - headers already sent by ... error because the code was trying to send the header directly in the preloaded request. The plugin should instead append the headers to the REST response vs outputting it straight away.

Copy link

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

I think this fix makes sense, thanks @srtfisher! Setting a header on the actual response rather than unconditionally sending it will fix the issue.

@jazzsequence jazzsequence changed the title Send the header to the result and not the server [BUGS-5914] Send the header to the result and not the server Aug 7, 2023
@jazzsequence jazzsequence changed the base branch from master to develop August 7, 2023 14:28
@jazzsequence jazzsequence merged commit 726d3cb into pantheon-systems:develop Aug 7, 2023
6 checks passed
@srtfisher srtfisher deleted the header-post-dispatch branch August 24, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUGS-5914] Do not send Surrogate-Key header when an internal REST request is dispatched
3 participants