-
Notifications
You must be signed in to change notification settings - Fork 445
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
Body parsing of request breaks odata batch requests #232
Comments
@cryxia firstly, I found that there is no request delimiters( |
@Huachao That's the thing, the example above is one request. And it does follow the multipart format structure. There are no delimiters because there is only one :p Each part is delimited by I know it's confusing because each part is in of itself a valid http request, but that's what odata batch requests are. Multiple http requests batched up in multipart/mixed http request. |
@cryxia The extension doesn't support multipart/mixed content type, I think that's the root cause. I will consider supporting this later. Thanks for your suggestion. |
@Huachao No problem. As I said I was hoping to help out by submitting a change for this when I had time. Thought I'd document it so that others can find this issue and know that someone is looking into it :) |
@cryxia that'll be appreciate. Thanks in advance. |
Just for information. static isMultiPartFormData(contentTypeString) {
if (!contentTypeString) {
return false;
}
return MimeUtility.parse(contentTypeString).type === 'multipart/form-data';
} with static isMultiPartFormData(contentTypeString) {
if (!contentTypeString) {
return false;
}
return MimeUtility.parse(contentTypeString).type === 'multipart/form-data'
|| MimeUtility.parse(contentTypeString).type === 'multipart/mixed';
} At first glance it doesn't looks like it needed any deep additional coding to support at least basic functionality. |
@Huachao |
All working now, thanks! |
Sorry, I don't have a good reproduction because I haven't found a public odata server that I can test this out on. However I'll detail the issue below and hopefully I'll find some time to do a fix. I wanted to log this issue so that others can find it.
The problem is that the parsing of the body of some requests is a little broken or out of order which results in odata batch requests being parsed incorrectly. These batch requests are multipart/mixed and inside each part the content looks like another http request.
See here for more details on the odata batch request format
Example request in rest client format:
The behaviour that I see that is that not all the body is sent - it appears to stop just before the first http like query in the body. I would expect the whole body to be sent
The text was updated successfully, but these errors were encountered: