[
https://issues.apache.org/jira/browse/WINK-361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13605406#comment-13605406
]
BK Lau commented on WINK-361:
-----------------------------
See the sample below using curl:
c:\curl>curl -u admin:admin -X GET -H "Accept:application/json" -v
"http://localhost:8000/books/N%2FA"
> GET /books/N%2FA HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.23.1 (x86_64-pc-win32) libcurl/7.23.1 OpenSSL/0.9.8r
> zlib/1.2.5
> Host: localhost:8000
> Accept:application/json
>
< HTTP/1.1 400 Bad Request
< Server: Apache-Coyote/1.1
< Content-Length: 0
< Date: Mon, 18 Mar 2013 17:15:09 GMT
< Connection: close
To recreate is very,very easy:
1. Create a simple resource to return "application/json" like this:
@Path("/books/{book-name}")
@Produces(value= {MediaType.APPLICATION_JSON})
@GET
Response getArchivesByName( @WADLDoc("Name of a book")
@PathParam("book-name") String bookName) throws
Exception;
Just hardcoded your implementation of above resource to return a simple JSON
String like {"name":"Hobbits"} or dummy JSON you like.
2. For @PathParam("book-name"), if you use any String as book name that has a
forward "/", you will get a "HTTP/1.1 400 Bad Request" right away.
There is not Wink errors being thrown that I can see.
I tested it with cURL and Chrome Plugin "POSTMAN" as well. Same error.
Summary:
book-name:
"Hello World" encoded as "Hello%20World" => OK
"Hello/World" encoded as "Hello%2FWorld" => Failed, got "HTTP/1.1 400 Bad
Request"
> Wink cannot resolved URI path segments that have encoded forward slashes
> -------------------------------------------------------------------------
>
> Key: WINK-361
> URL: https://issues.apache.org/jira/browse/WINK-361
> Project: Wink
> Issue Type: Bug
> Components: Server
> Affects Versions: 1.1.3
> Environment: Any
> Reporter: BK Lau
> Priority: Blocker
> Labels: Encoding, URI, forward, slashes
>
> Wink cannot resolve URI that have encoded forward slashes in them.
> Example: Consider the URI:
> /servers/{server}
> If the URI template parameter {server} is "http://abc.com:8000",
> one would get "404- Not Found" because of the "//" slashes
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira