Hi,

I have a @PUT service accepting any mime type as input. It just
manipulate it as byte[].

public Response putAttachment(@PathParam("wikiName") String wikiName,
@PathParam("spaceName") String spaceName,
        @PathParam("pageName") String pageName,
@PathParam("attachmentName") String attachmentName, byte[] content)

I recently upgraded from Restlet 1.1.10 to Restlet 2.0.11 and now the
following does not work anymore:

curl -u Admin:admin -T /home/test.pdf
http://127.0.0.1/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome/attachments/foo.pdf

but it's working well with

curl -u Admin:admin -T /home/test.pdf
http://127.0.0.1/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome/attachments/foo.pdf
-H "Content-Type:any/thing"

I debugged a bit and as far as I can see when no mime type is provided
the MediaType extracted from the entity is null in
org.restlet.ext.jaxrs.internal.wrappers.params.EntityGetter#getValue()
and whatever the supported mime type is
org.restlet.data.MediaType#isCompatible always return false if the
parameter is null even for the default @Consume which is  supposed to
mean anything ("*/*").

Is it a bug ? Does the REST spec say that mime type is required all
the time (did not reread it fully) ?

Thanks,
-- 
Thomas

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2920095

Reply via email to