Skip to content

Commit

Permalink
Try to update the port on scheme change.
Browse files Browse the repository at this point in the history
  • Loading branch information
o0Ignition0o committed Jul 20, 2019
1 parent 830c773 commit 0a2e796
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,13 @@ impl Url {

parser.serialization.push_str(self.slice(old_scheme_end..));
self.serialization = parser.serialization;

// Update the port so it can be removed
// If it is the scheme's default
if self.set_port(self.port()).is_err() {
return Err(());
};

Ok(())
}

Expand Down

0 comments on commit 0a2e796

Please sign in to comment.