Skip to content
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 quality factor to octet-stream mediatype #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgorman
Copy link

@cgorman cgorman commented Apr 25, 2023

Depending on the IMS implementation, they may return octet-stream when image/jpeg is available because octet-stream appears higher on the list of acceptable media types. This PR adds q=0.9 to the field value.

Fixes #80

@cgorman
Copy link
Author

cgorman commented Apr 25, 2023

I've tested this with Slim for a month or so using patch-package for local and remote IMS instances (dcm4chee, google, and GE) and it has been working well FWIW

Copy link
Contributor

@pieper pieper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment, but can you also provide some more context for why the change is needed and ideally a link to the standard describing this option?

@@ -860,6 +860,11 @@ class DICOMwebClient {
DICOMwebClient._assertMediaTypeIsValid(mediaType);
let fieldValue = `multipart/related; type="${mediaType}"`;

if (mediaType.endsWith("octet-stream")) {
// Prefer explicit transfer syntax
fieldValue += "; q=0.9";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to work in general? It looks somehow jpeg specific. Also, shouldn't it be something configurable by the user rather than hard-coded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IMS responds with octet-stream when image/jpeg is available
2 participants