Hi Timur
1) The "Slug" header must contain a %-encoded value (the encoding algorithm is given by the Atom spec,
here). The server decodes the Slug to obtain the filename on disk. So the following Slug:
Slug: http%3A%2F%2Fwww.example.org%2Fwinery%2FTEST%2Fjclouds2221
…will produce a file on disk named "
http://www.example.org/winery/TEST/jclouds2221", which is not a legal filename on most OS's (hence the 400 error).
2) The "Name" field is different -- since it's within the request body, it does not have to be encoded -- any valid JSON character can be used. Therefore this Name:
Both (1) and (2) are expected behavior.
Prior to Orion 4.0, the server handled case (1) incorrectly: the Slug was used as-is. This meant that the Slug could not be used to create files containing special characters. To complicate matters, pre-4.0 servers prioritized Name over Slug if both were provided. This
was fixed in 4.0.
So to summarize, in Orion 4.0:
- If you choose to provide a Slug, it must be encoded.
- If both a Slug and a Name are provided, the Slug takes priority.
- To minimize encoding headaches, you can just provide a Name in the request body and omit the Slug.
Mark