Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orion-dev] Usage of Slug Header, Name Attribute in the Body and URL encoding

Hi everyone,

The result of using slug header and name attribute is different during file creation. Is it the expected behavior? 

Whenever I want to create a file under project test using slug header:

-------------------------cut--------------------------
Orion-Version: 1.0
Slug: http%3A%2F%2Fwww.example.org%2Fwinery%2FTEST%2Fjclouds2221
Content-Type: text/xml
{
"Directory":"false"
}

 -- response --
400 Bad Request
Content-Type:  application/json; charset=UTF-8

Content-Length:  118

Server:  Jetty(8.1.10.v20130312)

{"Severity":"Error","Message":"Bad file name: http://www.example.org/winery/TEST/jclouds2221","HttpCode":400,"Code":0}
-------------------------end--------------------------

In contrast, it works fine with the name attribute:

-------------------------cut--------------------------
Orion-Version: 1.0
Content-Type: text/xml
{
"Directory":"false",
"Name":"http%3A%2F%2Fwww.example.org%2Fwinery%2FTEST%2Fjclouds2221"
}

 -- response --
201 Created
Cache-Control:  no-store

Content-Type:  application/json; charset=UTF-8

Location:  /file/timur/test/http%253A%252F%252Fwww.example.org%252Fwinery%252FTEST%252Fjclouds2221

Content-Length:  630

Server:  Jetty(8.1.10.v20130312)

{
  "Attributes": {
    "Executable": false,
    "ReadOnly": false,
    "SymLink": false
  },
  "Directory": false,
  "ImportLocation": "/xfer/import/timur/test/http%253A%252F%252Fwww.example.org%252Fwinery%252FTEST%252Fjclouds2221",
  "Length": 0,
  "LocalTimeStamp": 1384448839000,
  "Location": "/file/timur/test/http%253A%252F%252Fwww.example.org%252Fwinery%252FTEST%252Fjclouds2221",
  "Name": "http%3A%2F%2Fwww.example.org%2Fwinery%2FTEST%2Fjclouds2221",
  "Parents": [{
    "ChildrenLocation": "/file/timur/test/?depth=1",
    "Location": "/file/timur/test/",
    "Name": "test"
  }],
  "SearchLocation": "/filesearch?q="
}

-------------------------end--------------------------

The above case occurs only if the url encoding has been applied once. In case of multiple URL encodings the result is: 

-------------------------cut--------------------------

Orion-Version: 1.0
Slug: http%25253A%25252F%25252Fwww.example.org%25252Fwinery%25252FTEST%25252Fjclouds2221
Content-Type: text/xml
{
"Directory":"false"
}

 -- response --
201 Created
Cache-Control:  no-store

Content-Type:  application/json; charset=UTF-8

Location:  /file/timur/test/http%25253A%25252F%25252Fwww.example.org%25252Fwinery%25252FTEST%25252Fjclouds2221

Content-Length:  666

Server:  Jetty(8.1.10.v20130312)

{
  "Attributes": {
    "Executable": false,
    "ReadOnly": false,
    "SymLink": false
  },
  "Directory": false,
  "ImportLocation": "/xfer/import/timur/test/http%25253A%25252F%25252Fwww.example.org%25252Fwinery%25252FTEST%25252Fjclouds2221",
  "Length": 0,
  "LocalTimeStamp": 1384449060000,
  "Location": "/file/timur/test/http%25253A%25252F%25252Fwww.example.org%25252Fwinery%25252FTEST%25252Fjclouds2221",
  "Name": "http%253A%252F%252Fwww.example.org%252Fwinery%252FTEST%252Fjclouds2221",
  "Parents": [{
    "ChildrenLocation": "/file/timur/test/?depth=1",
    "Location": "/file/timur/test/",
    "Name": "test"
  }],
  "SearchLocation": "/filesearch?q="
}
-------------------------end--------------------------


In this request, the location is not encoded one more time unlike the behavior mentioned here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=416118

Is it a bug or the expected behavior of Orion? In the previous version, there was no such behavior.

Regards,

Timur
  

Back to the top