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

Add exception for set-cookie headers to always append #589

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions system/web/context/RequestContext.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1803,9 +1803,16 @@ component serializable="false" accessors="true" {
}
// Name Exists and not already set.
else if ( !isNull( arguments.name ) ) {
getPageContext()
.getResponse()
.setHeader( javacast( "string", arguments.name ), javacast( "string", arguments.value ) );

var response = getPageContext().getResponse();

// special exception for Set-Cookie. We always append this header, instead of overwriting
if ( arguments.name == "Set-Cookie" ) {
response.addHeader( javacast( "string", arguments.name ), javacast( "string", arguments.value ) );
} else {
response.setHeader( javacast( "string", arguments.name ), javacast( "string", arguments.value ) );
}

variables.responseHeaders[ arguments.name ] = arguments.value;
} else {
throw(
Expand Down
Loading