-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more headers in platform-http multipart uploads #17070
Conversation
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
@@ -117,6 +117,7 @@ public interface Exchange extends VariableAware { | |||
String CONTENT_TYPE = "Content-Type"; | |||
String COOKIE_HANDLER = "CamelCookieHandler"; | |||
String CORRELATION_ID = "CamelCorrelationId"; | |||
String ATTACHMENTS_SIZE = "CamelAttachmentsSize"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is somewhere you need to document this header, try look for some of the other headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also put it up to A headers so its sorted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah add it to ExchangePropertyKey
also and doc via @Metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm, I cannot find much documentation for other headers, should I annotate it with Metadata and add a description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/apache/camel/pull/17070/files#diff-c4832886119fc6dd6a4a54e68c5e2740ea9ae86b8699a469648284189d51e839 like this? I do not fully understand how ExchangePropertyKey
works, for example, FILE* related headers are not there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its the most commonly used headers - and since HTTP with attachments is fairly common then IMHO it would be okay to add here
** The file's content type in the "CamelFileContentType" message header | ||
** The file's size in the "CamelFileLength" message header |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick
** The file's content type in the "CamelFileContentType" message header | |
** The file's size in the "CamelFileLength" message header | |
** The file content type in the "CamelFileContentType" message header | |
** The file size in the "CamelFileLength" message header |
the size header should likely only be set if its > 0, as then it may be always there, also for just plain REST GET etc |
The ATTACHMENTS_SIZE header is added only during a multipart request. But I do not fully understand your comment. |
ah okay there was a if multipart check first - so this is fine. Just make sure on CSB that its also only added if really multipart data so its not there for anything else |
yup, same for CSB, all the logic is wrapped by https://github.com/apache/camel-spring-boot/blob/b358ea9050c281f550f7fc2cee12c055c5413371/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java#L98 |
No description provided.