Skip to content

Commit

Permalink
Add exception for set-cookie headers to always append (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
homestar9 authored Mar 13, 2024
1 parent 01d8ef1 commit 20cdbf5
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit 20cdbf5

Please sign in to comment.