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

Consider having HeaderWriters check before writing #6454

Closed
jzheaux opened this issue Jan 17, 2019 · 2 comments
Closed

Consider having HeaderWriters check before writing #6454

jzheaux opened this issue Jan 17, 2019 · 2 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Jan 17, 2019

Related to #5193

CacheControlHeaderWriter checks first before writing its corresponding headers.

Since HeaderWriterFilter writes headers at the end of a request, it makes sense that each HeaderWriter implementation would check whether its corresponding headers have already been written before overriding them.

That is, instead of doing:

response.setHeader(name, value)

do:

if (!response.hasHeader(name)) {
    response.setHeader(name, value);
}
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement labels Jan 17, 2019
@jzheaux jzheaux added this to the General Backlog milestone Jan 17, 2019
@ankurpathak
Copy link
Contributor

ankurpathak commented Jan 18, 2019

@jzheaux I will be working on this.

@ankurpathak
Copy link
Contributor

Here is a pull request:
#6456

ankurpathak added a commit to ankurpathak/spring-security that referenced this issue Feb 6, 2019
All HeadersWriter only write Header if its not already
written.

Fixes: spring-projectsgh-6454 spring-projectsgh-5193
@jzheaux jzheaux closed this as completed in 93d6a38 Feb 7, 2019
jzheaux added a commit that referenced this issue Feb 7, 2019
@jzheaux jzheaux self-assigned this Feb 7, 2019
@jzheaux jzheaux modified the milestones: General Backlog, 5.2.0.M2 Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants