-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCK: Dispatch forward and includes attributes do not meet the spec #9074
TCK: Dispatch forward and includes attributes do not meet the spec #9074
Conversation
…named-dispatch-include-attributes
@lachlan-roberts need your review on this. Pay particular attention to the changes to solve point 3 (ie reporting the values from the original request) - is there a better solution here? |
jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/Dispatcher.java
Outdated
Show resolved
Hide resolved
jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/Dispatcher.java
Show resolved
Hide resolved
jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/Dispatcher.java
Outdated
Show resolved
Hide resolved
…named-dispatch-include-attributes
/** | ||
* Name of original request attribute | ||
*/ | ||
public static final String __ORIGINAL_REQUEST = "org.eclipse.jetty.originalRequest"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe put ee10 in the name to protect against future cross context dispatches between ee10, ee11 and then back to ee10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you set the __ORIGINAL_REQUEST
attribute?
I would have thought it would be made available by ServletApiRequest#getAttribute
or something similar.
@lachlan-roberts case __ORIGINAL_REQUEST:
HttpServletRequest originalRequest = (HttpServletRequest)super.getAttribute(name);
return originalRequest == null ? _httpServletRequest : originalRequest; So the inner most forwarded wrapper works out that it is the innermost by getting a null value for the super.getAttribute, thus it returns it's wrapped request as the original. |
@gregw ok, so its not really the original request but the first forwarded request. |
It's the request wrapped by the first forwarded request, so that is either the original request or something that wraps the original request in a non consequential way. |
…x-document-modules * upstream/jetty-12.0.x: Issue jetty#9167 - making assumption in flaky test jetty 12.0.x cleanup duplicate osgi pom metadata (jetty#9093) Jetty 12 - Add tests in util/resource for alternate FileSystem implementations (jetty#9149) Cleanup non-retainable `Retainable`s (jetty#9159) Fixes retainability of special Chunks (jetty#9073) TCK: Dispatch forward and includes attributes do not meet the spec (jetty#9074) re-enable h3 tests (jetty#8773) More fundamental test case Reorganization of jetty-client classes. (jetty#9127) Removing @disabled from SslUploadTest Removing @disabled from jetty-start jetty#9134 added test ee10: DefaultServlet: Replace checks for isStreaming() by !isWriting() jetty#9078 make HttpContent.getByteBuffer() implementations return new ByteBuffer instances and document that contract Fixes jetty#9141 - Thread-safe Content.Chunk#slice (jetty#9142) Remove `@Disabled` from `jetty-jmx` (jetty#9143) Bump maven.version from 3.8.6 to 3.8.7 Bump maven.version from 3.8.6 to 3.8.7
… into jetty-12.0.x-documentation-lowercase-jetty_home-attribute * 'jetty-12.0.x' of https://github.com/eclipse/jetty.project: Issue jetty#9167 - making assumption in flaky test jetty 12.0.x cleanup duplicate osgi pom metadata (jetty#9093) Jetty 12 - Add tests in util/resource for alternate FileSystem implementations (jetty#9149) Cleanup non-retainable `Retainable`s (jetty#9159) Fixes retainability of special Chunks (jetty#9073) TCK: Dispatch forward and includes attributes do not meet the spec (jetty#9074) re-enable h3 tests (jetty#8773) More fundamental test case Reorganization of jetty-client classes. (jetty#9127) Removing @disabled from SslUploadTest Removing @disabled from jetty-start Bump maven.version from 3.8.6 to 3.8.7 Bump maven.version from 3.8.6 to 3.8.7
Fix several spec non-compliances with
forward
andinclude
attribute handling:include
must not have thejakarta.servlet.include.*
attributes set.forward
must not have thejakarta.servlet.forward.*
attributes set.forward
must report the values for thejakarta.servlet.forward.*
attributes as the equivalent values from the original request (iegetRequestURI
getPathInfo
getQueryString
etc etc) that went into the servlet call chain.Added tests for the above.