mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Make hidden input _charset_ check case insensitive
This commit is contained in:
parent
14fd2e56e6
commit
fa57ba5ca9
3 changed files with 3 additions and 7 deletions
|
@ -1328,7 +1328,7 @@ pub struct FormDatum {
|
|||
|
||||
impl FormDatum {
|
||||
pub fn replace_value(&self, charset: &str) -> String {
|
||||
if self.name == "_charset_" && self.ty == "hidden" {
|
||||
if self.name.to_ascii_lowercase() == "_charset_" && self.ty == "hidden" {
|
||||
return charset.to_string();
|
||||
}
|
||||
|
||||
|
@ -1753,7 +1753,7 @@ pub fn encode_multipart_form_data(
|
|||
// Step 3
|
||||
for entry in form_data.iter_mut() {
|
||||
// 3.1
|
||||
if entry.name == "_charset_" && entry.ty == "hidden" {
|
||||
if entry.name.to_ascii_lowercase() == "_charset_" && entry.ty == "hidden" {
|
||||
entry.value = FormDatumValue::String(DOMString::from(charset.clone()));
|
||||
}
|
||||
// TODO: 3.2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue