mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-12-30 22:43:48 +03:00
Strip quotes from X-Matrix fields
This commit is contained in:
parent
21ae63d46b
commit
5d8c80b170
1 changed files with 7 additions and 0 deletions
|
@ -315,6 +315,13 @@ impl Credentials for XMatrix {
|
||||||
for entry in parameters.split_terminator(',') {
|
for entry in parameters.split_terminator(',') {
|
||||||
let (name, value) = entry.split_once('=')?;
|
let (name, value) = entry.split_once('=')?;
|
||||||
|
|
||||||
|
// It's not at all clear why some fields are quoted and others not in the spec,
|
||||||
|
// let's simply accept either form for every field.
|
||||||
|
let value = value
|
||||||
|
.strip_prefix('"')
|
||||||
|
.and_then(|rest| rest.strip_suffix('"'))
|
||||||
|
.unwrap_or(value);
|
||||||
|
|
||||||
// FIXME: Catch multiple fields of the same name
|
// FIXME: Catch multiple fields of the same name
|
||||||
match name {
|
match name {
|
||||||
"origin" => origin = Some(value.try_into().ok()?),
|
"origin" => origin = Some(value.try_into().ok()?),
|
||||||
|
|
Loading…
Reference in a new issue