Mercurial > hg > orthanc
view INSTALL @ 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 | 630606097798 |
children | 0611aa383e62 |
line wrap: on
line source
Orthanc - A Lightweight, RESTful DICOM Server ============================================= Dependencies ------------ 1) CMake: Orthanc uses CMake (http://www.cmake.org/) to automate its building process. 2) Python: Some code is autogenerated through Python (http://www.python.org/). 3) Mercurial: To use the cutting edge code, a Mercurial client must be installed (http://mercurial.selenic.com/). We recommand TortoiseHg. W) 7-Zip: For the native build under Windows, the 7-Zip tool is used to uncompress the third-party packages (http://www.7-zip.org/). You thus have to download and install CMake, Python, Mercurial and possibly 7-Zip first. The path to their executable must be in the "PATH" environment variable. The other third party dependencies are automatically downloaded by the CMake scripts. The downloaded packages are stored in the "ThirdPartyDownloads" directory. Building Orthanc at a glance ---------------------------- To build Orthanc, you must: 1) Download the source code (either using Mercurial, or through the official releases). For the examples below, we assume the source directory is "~/Orthanc". 2) Create a build directory. For the examples below, we assume the build directory is "~/OrthancBuild". 3) Depending on your platform, follow the build instructions below. WARNING 1: If you do not create a fresh "~/OrthancBuild" directory after upgrading the source code (i.e. if you reuse the build directory that was used to build a different version of Orthanc), the build might fail because of changes in the compilation/linking flags. Always prefer to force a re-build in a new directory. WARNING 2: If cmake complains about not being able to uncompress third-party dependencies, delete the "~/Orthanc/ThirdPartyDownloads/" folder, then restart cmake. WARNING 3: If performance is important to you, make sure to add the option "-DCMAKE_BUILD_TYPE=Release" when invoking cmake. Indeed, by default, run-time debug assertions are enabled, which can seriously impact performance, especially if your Orthanc server stores a lot of DICOM instances. Native GNU/Linux Compilation ---------------------------- See the file "LinuxCompilation.txt". Native OS X Compilation ----------------------- See the file "DarwinCompilation.txt". Native Windows build with Microsoft Visual Studio ------------------------------------------------- # cd [...]\OrthancBuild # cmake -DSTANDALONE_BUILD=ON -DSTATIC_BUILD=ON -DALLOW_DOWNLOADS=ON -G "Visual Studio 8 2005" [...]\Orthanc Then open the "[...]/OrthancBuild/Orthanc.sln" with Visual Studio. NOTES: * More recent versions of Visual Studio than 2005 should also work. Type "cmake" without arguments to have the list of generators that are available on your computer. * You will have to install the Platform SDK (version 6 or above) for Visual Studio 2005: http://en.wikipedia.org/wiki/Microsoft_Windows_SDK. Read the CMake FAQ: http://goo.gl/By90B Cross-Compilation for Windows under GNU/Linux --------------------------------------------- To cross-compile Windows binaries under Linux using MinGW, please use the following command: # cd ~/OrthancBuild # cmake -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGWToolchain.cmake -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DCMAKE_BUILD_TYPE=Debug ~/Orthanc # make Native Windows build with MinGW (VERY SLOW) ------------------------------------------- # cd [...]\OrthancBuild # cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug [...]\Orthanc # mingw32-make