Mercurial > hg > orthanc
view TODO @ 2248:69b0f4e8a49b
Escape multipart type parameter value in Content-Type header
## Summary
Multipart responses do not quote/escape the value of their type
parameter (the subtype) even though it always contains at least one
special character (the slash "/"), which confuses standard-compliant
HTTP clients.
## Details
The Content-Type header in HTTP is in RFC 7231, Section 3.1.1.5:
https://tools.ietf.org/html/rfc7231#section-3.1.1.5
The section defers to the media type section (3.1.1.1) for the syntax of
the media type:
https://tools.ietf.org/html/rfc7231#section-3.1.1.1
This states that a parameter value can be quoted:
parameter = token "=" ( token / quoted-string )
A parameter value that matches the token production can be transmitted
either as a token or within a quoted-string. The quoted and unquoted
values are equivalent.
Tokens are defined in RFC 7230, Section 3.2.6 (via RFC 7231, appendix
C):
https://tools.ietf.org/html/rfc7231#appendix-C
https://tools.ietf.org/html/rfc7230#section-3.2.6
Here we observe that tokens cannot contain a slash "/" character:
token = 1*tchar
tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
/ "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
/ DIGIT / ALPHA
; any VCHAR, except delimiters
Delimiters are chosen from the set of US-ASCII visual characters not
allowed in a token (DQUOTE and "(),/:;<=>?@[\]{}").
However, the current implementation does not quote/escape the value of
the type parameter:
multipart/related; type=application/dicom
Instead, it should be:
multipart/related; type="application/dicom"
All of this also seems to apply to the MIME Content-Type header
definition, even though it is a little different:
https://www.iana.org/assignments/message-headers
https://tools.ietf.org/html/rfc2045#section-5.1
https://tools.ietf.org/html/rfc2387
author | Thibault Nélis <tn@osimis.io> |
---|---|
date | Mon, 16 Jan 2017 13:07:11 +0100 |
parents | 521adccdbfa0 |
children | d623bff7edab |
line wrap: on
line source
======================= === Orthanc Roadmap === ======================= The wishlist from Orthanc users is available on Trello: https://trello.com/b/gcn33tDM/orthanc-wishlist ======= General ======= * Configure an user-defined site UID root if generating DICOM UIDs ("FromDcmtkBridge::GenerateUuid()") * Support "/preview" and "/matlab" for LUT color images * Improve handling of errors in the command queue: https://groups.google.com/d/msg/orthanc-users/--njEbqcDDI/rBu8XL-Mm-cJ * Support partial file retrieval in Orthanc::HttpClient * Support retry counter in Orthanc::HttpClient * Option to enable DNS lookups in DICOM: https://goo.gl/woa35Z ======== REST API ======== ---------- Short-term ---------- * Create multi-frame images with /tools/create-dicom (by adding a "MultiFrame" flag to avoid creating a series) --------- Long-term --------- * Stick to the JSONapi or JAREST guidelines for a "v2" of the API: https://groups.google.com/forum/#!msg/orthanc-users/Bag-SwEE9ZI/-w7QXI6p7-oJ http://www.admiraalit.nl/jarest/ ===== DICOM ===== ---------- Short-term ---------- * Support C-GET: http://dclunie.blogspot.be/2016/05/to-c-move-is-human-to-c-get-divine.html * Check Big Endian transfer syntax in ParsedDicomFile::EmbedImage and DicomImageDecoder --------- Long-term --------- * Support DICOM TLS (cf. "--enable-tls" in storescp) * Support Storage Commitment: https://groups.google.com/forum/#!msg/orthanc-users/VZOn8St65jw/s8kg_OHesj0J ======= Plugins ======= --- SDK --- * Image transcoding API * Add plugins for normalized operations (notably so as to support Print SCU/SCP): https://www.medicalconnections.co.uk/kb/DICOM_Print_Service ---------------- Ideas of plugins ---------------- * DICOM-RT primitives (RT-STRUCT, RT-PLAN, RT-DOSE) * Converter to/from NIfTI * MySQL database plugin * Decode JPEG2k with grok: https://github.com/GrokImageCompression/grok * Generate dynamic content using Lua: https://groups.google.com/d/msg/orthanc-users/KompazkxRSs/5Rh03mzgDAAJ === Lua === * Configure HTTP headers from Lua (in HttpGet(), HttpPost(), HttpPut(), HttpDelete(), RestApiGet(), RestApiPost(), RestApiPut() and RestApiDelete(). https://groups.google.com/forum/#!msg/orthanc-users/WNnW187OILM/6XX_bm96BwAJ =========== Performance =========== ============ Orthanc Book ============ ================ Code refactoring ================ * Use Semaphore::Locker everywhere (instead of explicit Release() and Acquire()) * Avoid direct calls to FromDcmtkBridge (make most of its methods private), go through ParsedDicomFile wherever possible ================= Platform-specific ================= --------- Packaging --------- * CentOS and RHEL through EPEL: http://fedoraproject.org/wiki/EPEL_Package_Maintainers ------------------------ Big-endian architectures ------------------------ * Check the generated 16bpp PNG images ----------------- Microsoft Windows ----------------- * Add compatibility with non-ASCII paths (Orthanc expresses its paths as UTF-8 strings, but Windows expects them to be translated to the system locale) ===================== External applications ===================== * Create REST bindings with Slicer * Create REST bindings with Horos/OsiriX