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

Marshall IHttpRequestFeature.RawTarget #1463

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

kevinstapleton
Copy link
Contributor

Description of changes:
The HttpRequest.Path and HttpRequest.PathBase properties contain unescaped representations of the request path; however, it is sometimes useful to have access to the raw (escaped) request path as supplied exactly by the caller. Due to inconsistencies in URL escaping rules (that is, which characters are considered necessary to escape) and to the fact that the PathString type contains a partial unescaping, it is not possible to reconstruct the original, raw request path from the Path and PathBase properties.

The RawTarget property exists on the IHttpRequestFeature interface to address the above issue; however, that property is currently not set during request marshalling. This PR updates the MarshallRequest implementations to set the IHttpRequestFeature.RawTarget property.

All existing unit tests pass and new unit tests have been added to verify new functionality.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@normj normj changed the base branch from master to dev March 24, 2023 00:03
Copy link
Member

@normj normj left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for the detail PR.

@normj normj merged commit 60cc978 into aws:dev Mar 24, 2023
@normj
Copy link
Member

normj commented Mar 24, 2023

Version 8.1.0 of Amazon.Lambda.AspNetCoreServer has been released with this PR.

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.

None yet

2 participants