equal
deleted
inserted
replaced
211 return HttpTestHeaders.of(exchange.getResponseHeaders()); |
211 return HttpTestHeaders.of(exchange.getResponseHeaders()); |
212 } |
212 } |
213 @Override |
213 @Override |
214 public void sendResponseHeaders(int code, int contentLength) throws IOException { |
214 public void sendResponseHeaders(int code, int contentLength) throws IOException { |
215 if (contentLength == 0) contentLength = -1; |
215 if (contentLength == 0) contentLength = -1; |
216 if (contentLength < 0) contentLength = 0; |
216 else if (contentLength < 0) contentLength = 0; |
217 exchange.sendResponseHeaders(code, contentLength); |
217 exchange.sendResponseHeaders(code, contentLength); |
218 } |
218 } |
219 @Override |
219 @Override |
220 void doFilter(Filter.Chain chain) throws IOException { |
220 void doFilter(Filter.Chain chain) throws IOException { |
221 chain.doFilter(exchange); |
221 chain.doFilter(exchange); |
257 return HttpTestHeaders.of(exchange.getResponseHeaders()); |
257 return HttpTestHeaders.of(exchange.getResponseHeaders()); |
258 } |
258 } |
259 @Override |
259 @Override |
260 public void sendResponseHeaders(int code, int contentLength) throws IOException { |
260 public void sendResponseHeaders(int code, int contentLength) throws IOException { |
261 if (contentLength == 0) contentLength = -1; |
261 if (contentLength == 0) contentLength = -1; |
262 if (contentLength < 0) contentLength = 0; |
262 else if (contentLength < 0) contentLength = 0; |
263 exchange.sendResponseHeaders(code, contentLength); |
263 exchange.sendResponseHeaders(code, contentLength); |
264 } |
264 } |
265 void doFilter(Filter.Chain filter) throws IOException { |
265 void doFilter(Filter.Chain filter) throws IOException { |
266 throw new IOException("cannot use HTTP/1.1 filter with HTTP/2 server"); |
266 throw new IOException("cannot use HTTP/1.1 filter with HTTP/2 server"); |
267 } |
267 } |