Hallo,

I have two questions regarding the implementation in the 
TomcatResourceServlet.

First of all it initially checks for response.isCommited and then it also 
checks in some places before sending errors. It does not check in all 
places. I wonder should it always check or does it not need to check 
besides the initial one? It’s not clear what the pattern is, If it is 
supposed to check every time I would suggest to add a sendError private 
helper which does the check. Let me know if I should open a Jira/PR for 
that or if you prefer me removing the commiten checks.

BTW I submitted a trivial JavaDoc fix for copyRange. (I would have also 
renamed the method since it is not Range aware and therefore the name is 
missleading, however as the method is protected I chose not to. Let me know 
if you think such a fix is fine - or if we should try to make it Range 
aware)

Okay, so with the two housekeeping items out of the way, I have a more 
serious problem:

when requesting a non normalized URL which happens to be served by the 
default servlet it gets me the content of the bundle. This happens only on 
jboss7/jbossosgi and might be due to the way we set it up (in Karaf it does 
not happen).

curl -v --path-as-is http://localhost/context/nonexistent/../

I might open a separate issue/discussion for this, but before going into 
this deeper, I wonder can somebody confirm that requestURI is supposed to 
be not normalized when the servlet is executed and the exiting code which 
does for example prefix matches is not optimal? Is there a reason why it 
does not use pathInfo for example, which is normalized.

TomcatResourceServlet.java#L123 
<https://github.com/ops4j/org.ops4j.pax.web/blob/c80d5941eded7ae01bd4e468b1a0ac53a5761524/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/TomcatResourceServlet.java#L123>

This uses mapping.startsWith(context) which won’t work normally with 
/x/../context/ - or is there some wrappers/valve which is supposed to 
normalize this against servlet spec?

Gruss
Bernd



-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ops4j/e43ab5fb-5685-43fb-abe0-769a7af575d3%40googlegroups.com.

Reply via email to