Skip to content

ContentCachingResponseWrapper.ResponseServletOutputStream does not write data into original ServletOutputStream. #30535

@honhimW

Description

@honhimW

Question

When I use ContentCachingResponseWrapper, the response data is not written to the original output stream. Shouldn’t the data be written to the original output stream while being written to the cache?

private class ResponseServletOutputStream extends ServletOutputStream {
		private final ServletOutputStream os;
		public ResponseServletOutputStream(ServletOutputStream os) {
			this.os = os;
		}
		@Override
		public void write(int b) throws IOException {
                       // os.write(b);
			content.write(b);
		}
		@Override
		public void write(byte[] b, int off, int len) throws IOException {
                       // os.write(b, off, len);
			content.write(b, off, len);
		}
               // ...
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflow.comin: webIssues in web modules (web, webmvc, webflux, websocket)status: invalidAn issue that we don't feel is valid

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions