Skip to content

Commit dd224a3

Browse files
committed
Try to update the port on scheme change.
1 parent 830c773 commit dd224a3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,13 @@ impl Url {
19541954

19551955
parser.serialization.push_str(self.slice(old_scheme_end..));
19561956
self.serialization = parser.serialization;
1957+
1958+
// Update the port so it can be removed
1959+
// If it is the scheme's default
1960+
// We don't mind it silently failing
1961+
// If there was no port in the first place
1962+
let _ = self.set_port(self.port());
1963+
19571964
Ok(())
19581965
}
19591966

0 commit comments

Comments
 (0)