Uh oh!
There was an error while loading. Please reload this page.
Fix HTTP header parsing in SubmitBatch request - #2302
Conversation
a7122fa to
7c2d4ffCompare| keepAliveOptions: { enable: false }, | ||
| // Make sure HTTP headers are parsed properly with many HTTP | ||
| // header delimiters. | ||
| userAgentOptions: { userAgentPrefix: "include:HTTP:header:delimiter " } |
There was a problem hiding this comment.
Hmm... It seems that this doesn't change user-agent header in SubmitBatch request...
Could someone advice me how to write a test for this case? I want to add header-name: value:value header to SubmitBatch request...
There was a problem hiding this comment.
The JS SDK doesn't support to set headers in sub requests.
Seems you encountered the issue when you are using CPP sdk?
It should be fine if azurite can pass manual test. Could you share your repro project to me? Then I can run a manual test.
There was a problem hiding this comment.
OK.
Yes, we're using azure-sdk-for-cpp.
apache/arrow#38793 is the project (and the change) that encounters this problem.
But I disabled the test that encountered this problem for now: https://github.com/apache/arrow/pull/38793/files#diff-7d2cbf9c6abf1ee980b8cf5a79e222543c17b3d93b12c4c0c9fa123b1bb200b6R601-R604
Here is the test function that encountered this problem:
https://github.com/apache/arrow/pull/38793/files#diff-7d2cbf9c6abf1ee980b8cf5a79e222543c17b3d93b12c4c0c9fa123b1bb200b6R600-R624
Here is the code that creates a SubmitBatch request:
https://github.com/apache/arrow/pull/38793/files#diff-3bd20682a329dbf3fde0bed6310f07f71cd25312b24d4baa1de5764ebdc8c0acR1020-R1081
If you need more information, please let me know.
Anyway, I'll revert the blobbatch.test.ts change.
Wei Wei (blueww)
commented
Nov 22, 2023
Would you please help to look at the fix for blob batch code? |
If a SubmitBatch request has a HTTP header that has a HTTP header
delimiter (":") in its value, the SubmitBatch request is failed as
"400 One of the request inputs is not valid."
For example, if `user-agent` header is
`azsdk-cpp-storage-blobs/12.10.0-beta.1 (Darwin 23.1.0 arm64 Darwin
Kernel Version 23.1.0: Mon Oct 9 21:28:12 PDT 2023;
root:xnu-10002.41.9~6/RELEASE_ARM64_T8103)`, all `SubmitBatch()`
requests are failed.7c2d4ff to
15128c7CompareEmmaZhu-MSFT (EmmaZhu)
commented
Dec 19, 2023
/check-enforcer reset |
EmmaZhu-MSFT (EmmaZhu)
commented
Dec 19, 2023
I've manually tested the fixed. It works well with a header like |
EmmaZhu-MSFT (EmmaZhu)
commented
Dec 19, 2023
/check-enforcer evaluate |
EmmaZhu-MSFT (EmmaZhu)
commented
Dec 19, 2023
/check-enforcer reset |
EmmaZhu-MSFT (EmmaZhu)
commented
Dec 20, 2023
/check-enforcer evaluate |
I started hitting this in my unit tests as well now. |
If a SubmitBatch request has a HTTP header that has a HTTP header
delimiter (":") in its value, the SubmitBatch request is failed as
"400 One of the request inputs is not valid."
For example, if
user-agentheader isazsdk-cpp-storage-blobs/12.10.0-beta.1 (Darwin 23.1.0 arm64 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:12 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8103), allSubmitBatch()requests are failed.