forked from Deuxfleurs/garage
Panic when it is a logical error
This commit is contained in:
parent
d1b2fcc1e7
commit
cacf8ddf2d
1 changed files with 1 additions and 4 deletions
|
@ -77,10 +77,7 @@ fn authority_to_host(authority: &str) -> Result<&str, Error> {
|
||||||
let split = match first_char {
|
let split = match first_char {
|
||||||
'[' => {
|
'[' => {
|
||||||
let mut iter = iter.skip_while(|(_, c)| c != &']');
|
let mut iter = iter.skip_while(|(_, c)| c != &']');
|
||||||
iter.next().ok_or(Error::BadRequest(format!(
|
iter.next().expect("Authority parsing logic error");
|
||||||
"Authority {} has an illegal format",
|
|
||||||
authority
|
|
||||||
)))?;
|
|
||||||
iter.next()
|
iter.next()
|
||||||
}
|
}
|
||||||
_ => iter.skip_while(|(_, c)| c != &':').next(),
|
_ => iter.skip_while(|(_, c)| c != &':').next(),
|
||||||
|
|
Loading…
Reference in a new issue