users@jersey.java.net

Confusion with normalize/canonicalize features

From: Tim Edwards <Edwards.T_at_cambridgeassessment.org.uk>
Date: Mon, 25 Jan 2010 11:26:34 +0000

Hi,

I'm having a bit of a problem with FEATURE_NORMALIZE_URI / FEATURE_CANONICALIZE_URI_PATH and their interaction with FEATURE_REDIRECT. I have set normalize & canonicalize on but have redirect off. From my understanding of the javadoc for ResourceConfig.FEATURE_REDIRECT:

"If true, and either NORMALIZE_URI or CANONICALIZE_URI_PATH is true, and the normalization and/or path canonicalization operations on the request URI result in a new URI that is not equal to the request URI, then the client is (temporarily) redirected to the new URI. Otherwise the request URI is set to be the new URI."

This setup should result in the URI being rewritten if appropriate but with no temporary redirect. However my experience is that the rewritten URI is never used (resulting in a 404). Looking at the code for NormalizeFilter, I can see that if redirect is not set, then nothing happens with the rewritten URI.

Is this the intended behaviour? If so, it would imply the javadoc is misleading. If not, could be a bug. Or am I just missing something?

Cheers,
Tim



If you are not the intended recipient, employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination or copying of this communication and its attachments is strictly prohibited.
If you have received this communication and its attachments in error, please return the original message and attachments to the sender using the reply facility on e-mail.
Internet communications are not secure and therefore Cambridge Assessment (the brand name for the University of Cambridge Local Examinations Syndicate, the constituent elements of which are CIE, ESOL and OCR [Oxford Cambridge and RSA Examinations is a Company Limited by Guarantee Registered in England. Registered office: 1 Hills Road, Cambridge CB1 2EU. Company number: 3484466]) does not accept legal responsibility for the contents of this message.
Any views or opinions presented are solely those of the author and do not necessarily represent those of Cambridge Assessment unless otherwise specifically stated.
The information contained in this email may be subject to public disclosure under the Freedom of Information Act 2000. Unless the information is legally exempt from disclosure, the confidentiality of this email and your reply cannot be guaranteed.