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 dd224a3
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
// We don't mind it silently failing
// If there was no port in the first place
let _ = self.set_port(self.port());

Ok(())
}

Expand Down

0 comments on commit dd224a3

Please # to comment.