Repository navigation
script: Escape field names and values for default x-www-form-urlencoded <form> POST - #44953
Merged
Merged
Conversation
Signed-off-by: Euclid Ye <[email protected]>
Signed-off-by: Euclid Ye <[email protected]>
TimvdLippe
approved these changes
May 16, 2026
| buf | ||
| } | ||
|
|
||
| fn normalize_crlf_for_domstring(s: &DOMString) -> String { |
Contributor
There was a problem hiding this comment.
Can this be an impl DOMString?
Member
Author
There was a problem hiding this comment.
We can try. We would need to change replace_value to return DOMString then. We can then save a function and some confusing string conversion it seems.
Member
Author
There was a problem hiding this comment.
This refactor might deserve a separate review. It is more than a refactor as we need to remove some duplicate steps to make it happen.
Let me post it in a separate PR.
yezhizhen
marked this pull request as draft
May 16, 2026 07:48
Signed-off-by: Euclid Ye <[email protected]>
yezhizhen
marked this pull request as ready for review
May 16, 2026 08:59
pull Bot
pushed a commit
to AKJUS/servo
that referenced
this pull request
May 16, 2026
…vo#44954) Sorry for the messy title. But there are quite a few things going on. 1. There was a redundant special casing in `fn replace_value`. It was already done in https://github.com/servo/servo/blob/0d283f6c2b484c712129b6ad41f8c2c7488d0447/components/script/dom/html/input_element/mod.rs#L1655-L1657 It is important to remove it, to make `fn replace_value` return `&DOMString` without cloning and String conversion. 2. Move `normalize_crlf` to `impl DOMString` Testing: [Try](https://github.com/servo/servo/actions/runs/25958542073). This is refactor + removing redundant code. Part of servo#10778 Addresses servo#44953 (comment) --------- Signed-off-by: Euclid Ye <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec for submit entity body (POST) for x-www-form-urlencoded.
We also extract inner fn
clean_crlftonormalize_crlfas this is widely common.Follow up of #44943.
Testing: Passing in existing tests.
Part of #10778. (Well this isn't FileAPI, but that's what led me here.)