Skip to content

Commit d3e746d

Browse files
committed
Try to update the port on scheme change.
1 parent 241d15c commit d3e746d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,6 +2010,13 @@ impl Url {
20102010

20112011
parser.serialization.push_str(self.slice(old_scheme_end..));
20122012
self.serialization = parser.serialization;
2013+
2014+
// Update the port so it can be removed
2015+
// If it is the scheme's default
2016+
// We don't mind it silently failing
2017+
// If there was no port in the first place
2018+
let _ = self.set_port(self.port());
2019+
20132020
Ok(())
20142021
}
20152022

0 commit comments

Comments
 (0)