Skip to content

Conversation

@elmuerte
Copy link
Contributor

@elmuerte elmuerte commented Sep 5, 2025

Fixes issue #454

Changed BOM uploading to using the POST API by default. When needed users can still use the PUT API to upload by setting the
configuration flag uploadWithPut. Primary reason for switching to the POST API is because it plays nicer with WebApplication Firewalls in case of large request payloads.

Note that the POST and PUT APIs have subtle differences in the request parameters.

Further more, the BOM content is no longer kept in memory during upload, instead an InputStream is passed on to the different request handlers. This should also have a positive effect when processing huge SBOMs.

This took a little big more effort than I expected.

The commons-logging pulled in by the Apache HttpClient used by Unirest
does not support slf4j, which is used by Maven. Due to this you cannot
easily enable HttpClient's debug logging.
When needed users can still use the PUT API to upload by setting the
configuration flag `uploadWithPut`. Primary reason for switching to the
POST API is because it plays nicer with WebApplication Firewalls in case
of large request payloads.

Note that the POST and PUT APIs have subtle differences in the request
parameters.

Further more, the BOM content is no longer kept in memory during upload,
instead an InputStream is passed on to the different request handlers.
This should also have a positive effect when processing huge SBOMs.
This results in the Content-Length being set in the request.
@elmuerte elmuerte force-pushed the bugfix/454-post-sbom branch from 824c589 to 935abab Compare September 5, 2025 12:18
@elmuerte
Copy link
Contributor Author

@pmckeown have you had the time to look at this PR yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant