https://github.com/anton-johansson/cxf-write-headers-after-body
This repository contains tests to mess around with writing headers after the body.
https://github.com/anton-johansson/cxf-write-headers-after-body
Last synced: 4 months ago
JSON representation
This repository contains tests to mess around with writing headers after the body.
- Host: GitHub
- URL: https://github.com/anton-johansson/cxf-write-headers-after-body
- Owner: anton-johansson
- License: apache-2.0
- Created: 2018-01-31T16:57:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-31T17:15:07.000Z (over 7 years ago)
- Last Synced: 2024-12-26T23:43:49.224Z (5 months ago)
- Language: Java
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CXF, writing headers after body
This repository contains tests to mess around with writing headers after the body.
The main idea is that some API's require an `Authorization`-header that depends on the body. For example `Authorization: MyApp `.
There is a related [JIRA issue](https://issues.apache.org/jira/browse/CXF-7627) for this.
## Scenarios
There are three scenarios set up:
* Chunking allowed, where the size of the body **does not** exceed the chunking threshold
* Chunking allowed, where the size of the body **does** exceed the chunking threshold
* Chunking disabledOnly the first scenario actually works. After messing around a bit with this, I understand why this happens. CXF obviously wants to write directly to the output stream as soon as possible, and it makes no sense to write headers after that point. The purpose of this repository is to find a decent solution or workaround. For now, I've simply raised the chunking threshold to get around the problem in my production environment, however it doesn't feel like an okay work around.
## License
Apache License © [Anton Johansson](https://github.com/anton-johansson)