[ https://issues.apache.org/jira/browse/CXF-7627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16348897#comment-16348897 ]
Anton Johansson commented on CXF-7627: -------------------------------------- Okay, sorry, I'll start a user discussion next time. However, regarding the logging issue. Wouldn't that be considered a bug? If so, I guess I could leave this open? > CXF, write headers after body > ----------------------------- > > Key: CXF-7627 > URL: https://issues.apache.org/jira/browse/CXF-7627 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Reporter: Anton Johansson > Priority: Major > > I'm not sure if this is considered a bug and if I've specified the correct > component in this issue, but I'll give this a try. > I'm working with a couple of API's using CXF, that requires an Authorization > header that depends on the data being sent. I have some issues with this, and > I've created a GitHub repository to reproduce my problem. You can find it > here: > [https://github.com/anton-johansson/cxf-write-headers-after-body] > Basically, I can only write headers after the body when I'm using chunked > transport and I haven't reached the second chunk yet. > After messing around with this I completely understand that this is how it > works. CXF obviously wants to write data to the output stream as soon as > possible, and it makes no sense to write headers after that. > I'm merely looking for suggestions or ideas how I can solve my problem. For > now I've simply raised the chunked threshold to get around the issue in > production, but I need a better, long-term solution. Is there any way to say > to CXF that it should always generate the output data in an earlier phase, so > I can always access it before headers are written? This of course removes the > possibility for using chunked data, but I feel this is something that should > exist in CXF. I would really want to avoid building my requests by hand. :( > > Also, something that is *very* scary, is that the output that the > LoggingFeature gives me says that the header is actually sent, even though it > is not sent. This caused some unnecessary discussions with our partners. :D I > assume the logging feature simply takes the Header-map, but if it has been > modified after the data has been written, this can be very confusing. Is > there any way to solve that? -- This message was sent by Atlassian JIRA (v7.6.3#76005)