-
Notifications
You must be signed in to change notification settings - Fork 352
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
OData Batch Requests fails to handle duplicate http attributes #2656
Comments
@apiaskowski thanks for reporting this. Would you consider contributing a PR to address this? |
@habbes my PR bugfix is in preparation. |
Dear @habbes, I've got to take back my PR, because of legal reasons with the CLA that have to be sorted out by my employer. The issue occurs, because of missing checks in the Examples:
In addition I've observed potential Examples: |
@apiaskowski was this issue observed when using JSON batch or Multipart mixed format or both formats? |
We've been using the content-type json and not multipart. |
…sonLightBatchPayloadItemPropertiesCache, refs: OData#2656
…sonLightBatchPayloadItemPropertiesCache, refs: OData#2656
Sending OData batch requests with duplicate http headers will cause an System.ArgumentException that indicates that duplicate http headers are not validated correct.
Assemblies affected
Microsoft.OData.Core 7.15.0
Reproduce steps
Create a basic MVC OData service and enable batch requests.
Submit any batch request, which includes the same http header twice
Expected result
If a duplicate http header has been send, the duplicate header(s) should be ignored or overwrite the previous value.
Actual result
The OData batch requests returns an HTTP 500 error, with the System.ArgumentException: An item with the same key has already been added. Key: .
This is caused by the Microsoft.OData.JsonLight.BatchPayloadItemPropertiesCache which doesn't validate, if an http header already has been added to the headers Dictionary.
The text was updated successfully, but these errors were encountered: