DependencyTrack / DependencyTrack/dependency-track
Add possibility to set max header size for requests
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
### Current Behavior
Referring to discussion https://github.com/DependencyTrack/dependency-track/discussions/3384
It's currently not possible to set the max header size for embedded Jetty server.
In class EmbeddedJettyServer public method main (package alpine.embedded) there's no way to to set this configuration property by CLI argument or config file.
### Proposed Behavior
Proposal:
---
public static void main(String[] args) throws Exception {
---
CliArgs cliArgs = new CliArgs(args);
---
Server server = new Server();
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.addCustomizer(new ForwardedRequestCustomizer());
HttpConnectionFactory connectionFactory = new HttpConnectionFactory(httpConfig);
ServerConnector connector = new ServerConnector(server, new ConnectionFactory[]{connectionFactory});
connector.setHost(host);
connector.setPort(port);
---
I would recommend to add a CLI arg and pass it to method httpConfig.setRequestHeaderSize(cliArgs.switchIntegerValue("-maxRequestHeaderSize", 8192));
### Checklist
- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this enhancement was already requested
Contributor guide
Assessment
This issue has not been assessed yet.