Skip to content

Add a composite HeaderWriter class #6453

Closed
@jzheaux

Description

@jzheaux

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);
}

Metadata

Metadata

Assignees

Labels

in: webAn issue in web modules (web, webmvc)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions