Mercurial Hosting > luan
comparison src/goodjava/webserver/ChunkedOutputStream.java @ 2010:f45ed55f5c11 default tip
fix chunked encoding
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 02 Sep 2025 06:00:41 -0600 |
parents | bba3e529e346 |
children |
comparison
equal
deleted
inserted
replaced
2009:f1d9679308f0 | 2010:f45ed55f5c11 |
---|---|
17 | 17 |
18 public ChunkedOutputStream(Response response) { | 18 public ChunkedOutputStream(Response response) { |
19 if(response==null) throw new NullPointerException(); | 19 if(response==null) throw new NullPointerException(); |
20 this.response = response; | 20 this.response = response; |
21 response.headers.put("Transfer-Encoding","chunked"); | 21 response.headers.put("Transfer-Encoding","chunked"); |
22 response.headers.put("X-Accel-Buffering","no"); | |
22 response.body = new ChunkedInputStream(); | 23 response.body = new ChunkedInputStream(); |
23 } | 24 } |
24 | 25 |
25 @Override public synchronized void close() { | 26 @Override public synchronized void close() { |
26 if( status == OPEN ) { | 27 if( status == OPEN ) { |