Skip to content
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

Parameter error handling #646

Merged
merged 8 commits into from
Aug 22, 2023
Merged

Conversation

markt-asf
Copy link
Contributor

This PR updates the parameter error handling to align with the changes in Jakarta Servlet 6.0

The short version is all getParameterXXX() calls now throw exceptions on invalid parameters.
Note that getParts() still needs to work even if the query string parameters are invalid.

I'm providing this as a PR to give folks a chance to review it before it is merged given that it is a significant change.

@aooohan
Copy link
Member

aooohan commented Aug 19, 2023

This change look good for me.
But I have found that org.apache.catalina.valves.ExtendedAccessLogValve.RequestParameterElement behavior is broken due to this change. Maybe here should catch InvalidParameterException, right ? Also, we should check if exist others call getParameterXXXX internally after this change merged. : )

@markt-asf
Copy link
Contributor Author

Thanks for the review. I checked the various getParameter() methods and found a couple I thought needed a try/catch block. The remainder were all used in webapps or in APIs called by applications and I think throwing the exception is OK in those cases.

Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments...

webapps/docs/changelog.xml Outdated Show resolved Hide resolved
webapps/docs/config/ajp.xml Outdated Show resolved Hide resolved
webapps/docs/config/http.xml Outdated Show resolved Hide resolved
@markt-asf markt-asf force-pushed the parameter-error-handling branch 2 times, most recently from 1ddbaa8 to 1ce49d5 Compare August 21, 2023 21:07
Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections anymore

@markt-asf markt-asf merged commit 32b48ca into apache:main Aug 22, 2023
4 checks passed
@markt-asf markt-asf deleted the parameter-error-handling branch August 22, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants