-
Notifications
You must be signed in to change notification settings - Fork 167
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
Error deleting a dicom study or retrieving a study using REST API #1396
Comments
Hi @mhassaninmsft, can you clarify what tool you're using to send the GET request? If you enabled the Swagger UI, that's not currently supported due to accessibility issues. I did just check your scenario against the Postman collection, and I was able to retrieve a study as a multipart response successfully. Looking at your request, there are two things that stand out:
Please let me know if this works for you! |
And the spec does say that the media type param value can be quoted or unquoted - that's a bug on us. edit: this is generally true, but not in this case, see below |
Correction of above - our current handling of quotes is correct according to the Dicom standard:
Closing this issue - thanks for raising it! |
Describe the bug
The application does not respect the HTTP 'Accept' headers in the request. When we provide -H 'accept:multipart/related; type=application/dicom' The application only receives.
application/dicom
and not the multipart/related part of the header which causes some checks later in the request to fail (the checks enforce both application/dicom as the only supported media type and also expect the multipart/related section.\dicom-server\src\Microsoft.Health.Dicom.Api\Extensions\HttpRequestExtensions.cs
The call to the methodhttpRequest.GetTypedHeaders().Accept
returns a list ofMediaTypeHeaderValue
which seems strange, As per the class doc on Microsoft, the class is used for content type and not accept headers. The call tohttpRequest.GetTypedHeaders().Accept
only returnsapplication/dicom
and not themultipart/related
section. However, a call tohttpRequest.Headers.GetCommaSeparatedValues(HeaderNames.Accept)
returns the correct headers.MediaTypeHeaderValue
for accept header to a custom implemnted header handler.MediaTypeHeaderValue
to accept the correct headler by callingnew MediaTypeHeaderValue(new StringSegment(x, 0, x.Length))
wherex = "multipart/related; type=application/dicom"
, but that threw a formatting exception confirming it is not the correct abstraction.To Reproduce
Steps to reproduce the behavior:
curl -X 'GET' 'https://localhost:63838/v1/studies/1.2.826.0.1.3680043.8.498.13230779778012324449356534479549187420' -H 'accept:multipart/related; type=application/dicom' -H 'content-type: application/dicom' substitue the study instace id with the apporpiate study instance if of the file you uploaded in step 2.
You will get an exception:
"Headers are not supported"
Expected behavior
Successful Response with the study file or an empoty response when deleting the study
Actual behavior
Headers not supported exxeption
The text was updated successfully, but these errors were encountered: