Skip to content

Commit

Permalink
Auto merge of #10287 - Ms2ger:domain, r=jdm
Browse files Browse the repository at this point in the history
Include square brackets for IPv6 addresses in Document::domain.

The specification changed out from under us.

It's unfortunately impossible to write a test for this right now.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10287)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Mar 31, 2016
2 parents ed9c64e + 231208a commit af06d32
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions components/script/dom/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1767,12 +1767,6 @@ impl DocumentMethods for Document {
fn Domain(&self) -> DOMString {
// TODO: This should use the effective script origin when it exists
let origin = self.window.get_url();

if let Some(&Host::Ipv6(ipv6)) = origin.host() {
// Omit square brackets for IPv6 addresses.
return DOMString::from(ipv6.to_string());
}

DOMString::from(origin.serialize_host().unwrap_or_else(|| "".to_owned()))
}

Expand Down

0 comments on commit af06d32

Please sign in to comment.