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 a composite HeaderWriter class #6453

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

Add a composite HeaderWriter class #6453

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

DelegatingRequestMatcherHeaderWriter would be handier in combination with a composite HeaderWriter implementation:

new DelegatingRequestMatcherHeaderWriter(requestMatcher,
    new CompositeHeaderWriter(headerWriterList));

It would also simplify code in certain areas like HeaderWriterFilter:

public HeaderWriterFilter(List<HeaderWriter> headerWriters) {
    // ...
    this.headerWriters = headerWriters;
}

public void doFilterInternal(...) {
    // ...

    for (HeaderWriter headerWriter : this.headerWriters) {
        headerWriter.writeHeaders(request, response);
    }
}

would simplify to:

public HeaderWriterFilter(List<HeaderWriter> headerWriters) {
    // ...
    this.headerWriter = new CompositeHeaderWriter(headerWriters);
}

public void doFilterInternal(...) {
    // ...

    this.headerWriter.writeHeaders(request, response);
}
@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) New Feature status: ideal-for-contribution An issue that we actively are looking for someone to help us with labels Jan 17, 2019
@jzheaux jzheaux added this to the General Backlog milestone Jan 17, 2019
@jzheaux jzheaux changed the title Consider adding a composite HeaderWriter class Add a composite HeaderWriter class Jan 17, 2019
@ankurpathak
Copy link
Contributor

@jzheaux I would like to take this one.

@ankurpathak
Copy link
Contributor

Here is a pull request:
#6455

@jzheaux jzheaux modified the milestones: General Backlog, 5.2.0.M2 Jan 18, 2019
jzheaux added a commit that referenced this issue Jan 21, 2019
jzheaux added a commit that referenced this issue Jan 21, 2019
Changed test to favor mocks in order to provide a stronger
guarantee that the composite delegates to its components.

Issue: gh-6453
@rwinch rwinch removed status: ideal-for-contribution An issue that we actively are looking for someone to help us with labels Jan 29, 2019
@jzheaux jzheaux self-assigned this Apr 15, 2019
@rwinch rwinch added the type: enhancement A general enhancement label May 3, 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

Successfully merging a pull request may close this issue.

3 participants