Mercurial > hg > orthanc
view LinuxCompilation.txt @ 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 | 741765ec8374 |
line wrap: on
line source
This file is a complement to "INSTALL", which contains instructions that are specific to GNU/Linux. Static linking for GNU/Linux ============================ The most simple way of building Orthanc under GNU/Linux consists in statically linking against all the third-party dependencies. In this case, the system-wide libraries will not be used. The build tool (CMake) will download the sources of all the required packages and automatically compile them. This process should work on any GNU/Linux distribution, provided that a C/C++ compiler ("build-essential" in Debian-based systems), the Python interpreter, CMake, the "unzip" system tool, and the development package for libuuid ("uuid-dev" in Debian) are installed. We now make the assumption that Orthanc source code is placed in the folder "~/Orthanc" and that the binaries will be compiled to "~/OrthancBuild". To build binaries with debug information: # cd ~/OrthancBuild # cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Debug ~/Orthanc # make # make doc To build a release version: # cd ~/OrthancBuild # cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ~/Orthanc # make # make doc Note 1- When the "STATIC_BUILD" option is set to "ON", the build tool will not ask you the permission to download packages from the Internet. Note 2- If the development package of libuuid was not installed when first invoking cmake, you will have to manually remove the build directory ("rm -rf ~/OrthancBuild") after installing this package, then run cmake again. Note 3- To build the documentation, you will have to install doxyen. Use system-wide libraries under GNU/Linux ========================================= Under GNU/Linux, by default, Orthanc links against the shared libraries of your system (the "STATIC_BUILD" option is set to "OFF"). This greatly speeds up the compilation. This is also required when building packages for GNU/Linux distributions. Because using system libraries is the default behavior, you just have to use: # cd ~/OrthancBuild # cmake -DCMAKE_BUILD_TYPE=Debug ~/Orthanc # make Note that to build the documentation, you will have to install doxyen. However, on some GNU/Linux distributions, it is still required to download and static link against some third-party dependencies, e.g. when the system-wide library is not shipped or is outdated. Because of difference in the packaging of the various GNU/Linux distribution, it is also sometimes required to fine-tune some options. You will find below build instructions for specific GNU/Linux distributions. Distributions tagged by "SUPPORTED" are tested by Sébastien Jodogne. Distributions tagged by "CONTRIBUTED" come from Orthanc users. SUPPORTED - Debian Jessie/Sid ----------------------------- # sudo apt-get install build-essential unzip cmake mercurial \ uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \ libgtest-dev libpng-dev libjpeg-dev \ libsqlite3-dev libssl-dev zlib1g-dev libdcmtk2-dev \ libboost-all-dev libwrap0-dev libjsoncpp-dev libpugixml-dev # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_SYSTEM_MONGOOSE=OFF \ -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \ -DDCMTK_LIBRARIES=dcmjpls \ ~/Orthanc Note: Have also a look at the official package: http://anonscm.debian.org/viewvc/debian-med/trunk/packages/orthanc/trunk/debian/ SUPPORTED - Ubuntu 12.04.5 LTS ------------------------------ # sudo apt-get install build-essential unzip cmake mercurial \ uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \ libgtest-dev libpng-dev libsqlite3-dev libssl-dev libjpeg-dev \ zlib1g-dev libdcmtk2-dev libboost1.48-all-dev libwrap0-dev \ libcharls-dev # cmake "-DDCMTK_LIBRARIES=boost_locale;CharLS;dcmjpls;wrap;oflog" \ -DALLOW_DOWNLOADS=ON \ -DUSE_SYSTEM_MONGOOSE=OFF \ -DUSE_SYSTEM_JSONCPP=OFF \ -DUSE_SYSTEM_PUGIXML=OFF \ -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \ ~/Orthanc SUPPORTED - Ubuntu 14.04 LTS ---------------------------- # sudo apt-get install build-essential unzip cmake mercurial \ uuid-dev libcurl4-openssl-dev liblua5.1-0-dev \ libgtest-dev libpng-dev libsqlite3-dev libssl-dev libjpeg-dev \ zlib1g-dev libdcmtk2-dev libboost-all-dev libwrap0-dev \ libcharls-dev libjsoncpp-dev libpugixml-dev # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \ -DUSE_SYSTEM_MONGOOSE=OFF \ -DDCMTK_LIBRARIES=dcmjpls \ ~/Orthanc SUPPORTED - Fedora 20-22 ------------------------ # sudo yum install unzip make automake gcc gcc-c++ python cmake \ boost-devel curl-devel dcmtk-devel \ gtest-devel libpng-devel libsqlite3x-devel libuuid-devel jpeg-devel \ mongoose-devel openssl-devel jsoncpp-devel lua-devel pugixml-devel You will also have to install "gflags-devel" on Fedora 21&22: # sudo yum install gflags-devel # cmake "-DDCMTK_LIBRARIES=CharLS" \ -DSYSTEM_MONGOOSE_USE_CALLBACKS=OFF \ ~/Orthanc Note: Have also a look at the official package: http://pkgs.fedoraproject.org/cgit/orthanc.git/tree/?h=f18 SUPPORTED - FreeBSD 10.1 ------------------------ # pkg install jsoncpp pugixml lua51 curl googletest dcmtk cmake jpeg \ e2fsprogs-libuuid boost-libs sqlite3 python libiconv # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_SYSTEM_MONGOOSE=OFF \ -DDCMTK_LIBRARIES="dcmdsig;charls;dcmjpls" \ ~/Orthanc SUPPORTED - CentOS 6 -------------------- # yum install unzip make automake gcc gcc-c++ python cmake curl-devel \ libpng-devel sqlite-devel libuuid-devel openssl-devel \ lua-devel mercurial patch tar # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_SYSTEM_JSONCPP=OFF \ -DUSE_SYSTEM_MONGOOSE=OFF \ -DUSE_SYSTEM_PUGIXML=OFF \ -DUSE_SYSTEM_SQLITE=OFF \ -DUSE_SYSTEM_BOOST=OFF \ -DUSE_SYSTEM_DCMTK=OFF \ -DUSE_SYSTEM_GOOGLE_TEST=OFF \ -DUSE_SYSTEM_LIBJPEG=OFF \ ~/Orthanc Other GNU/Linux distributions? ------------------------------ Please send us your build instructions (by a mail to s.jodogne@gmail.com)! You can find build instructions for Orthanc up to 0.7.0 on the following Wiki page: https://code.google.com/p/orthanc/wiki/LinuxCompilationUpTo070 These instructions will not work as such beyond Orthanc 0.7.0, but they might give indications. Using ccache ============ Under GNU/Linux, you also have the opportunity to use "ccache" to dramatically decrease the compilation time when rebuilding Orthanc. This is especially useful for developers. To this end, you would use: # CC="ccache gcc" CXX="ccache g++" cmake ~/Orthanc [Other Options]