Skip to content

Commit

Permalink
Adapt TCK WriterInterceptor to remove the Content-Length header
Browse files Browse the repository at this point in the history
Because it changes the content, and the server is right in adding this header.
See quarkusio/quarkus#16286
  • Loading branch information
FroMage committed Apr 20, 2021
1 parent 0ce5dbc commit 7ed2bfb
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -19,6 +19,7 @@
import java.io.IOException;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.Provider;
import javax.ws.rs.ext.WriterInterceptor;
Expand Down Expand Up @@ -47,5 +48,7 @@ public void aroundWriteTo(WriterInterceptorContext context)
headers.remove(Resource.HEADERNAME);
}
context.proceed();
// RR: make sure we remove this header since we mucked with the content
context.getHeaders().remove(HttpHeaders.CONTENT_LENGTH);
}
}

0 comments on commit 7ed2bfb

Please sign in to comment.