From bc304f3531c09fa6abdaebb1800b1635d9fe5297 Mon Sep 17 00:00:00 2001 From: Sam Dutton Date: Thu, 5 Oct 2023 17:20:54 +0100 Subject: [PATCH] Minor tweaks to language --- src/site/content/en/blog/url/index.md | 69 ++++++++++++++------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/site/content/en/blog/url/index.md b/src/site/content/en/blog/url/index.md index ccc4dfacf8b..7c240c71ed3 100644 --- a/src/site/content/en/blog/url/index.md +++ b/src/site/content/en/blog/url/index.md @@ -29,7 +29,7 @@ Names for URL parts are specified in a standard, which also defines a JavaScript defines methods to provide access to parts of a URL string, such as the [scheme](#scheme) or [origin](#heading=h.17kwt3yobyfm). -This article explains a range of terms used with HTTP or HTTPS URLs, but does not cover other types +This article explains a range of terms used with HTTP or HTTPS URLs. It does not cover other types of URL such as file or data URLs. For terms such as `host` and `origin`, accurate definitions are inherently complex, so this article provides examples and links to the URL Standard, rather than attempting full explanations. @@ -159,22 +159,22 @@ the port. URL -
URL.host
+ URL.host https://www.example.com:443/cat -
www.example.com
-// 443 is the default port for the scheme
+ www.example.com +// 443 is the default port for the scheme https://www.example.com:1234/cat -
www.example.com:1234
+ www.example.com:1234 https://cat.example.github.io -
cat.example.github.io
+ cat.example.github.io @@ -194,21 +194,21 @@ Hostname is defined by the JavaScript `URL` API, but not elsewhere by the URL St URL -
URL.hostname
+ URL.hostname https://www.example.com:443/cat -
www.example.com
+ www.example.com https://www.example.com:1234/cat -
www.example.com
+ www.example.com https://cat.example.github.io -
cat.example.github.io
+ cat.example.github.io @@ -229,21 +229,21 @@ for the scheme). URL -
URL.origin
+ URL.origin https://www.example.com:443/cat -
https://www.example.com
+ https://www.example.com https://www.example.com:1234/cat -
https://www.example.com:1234
+ https://www.example.com:1234 https://cat.example.github.io -
https://cat.example.github.io
+ https://cat.example.github.io @@ -270,25 +270,25 @@ defined) but not including the [search string](#search) or [hash](#hash). URL -
URL.pathname
+ URL.pathname https://example.com -
[empty string]
+ [empty string] https://example.com:8000/search?q=tabby -
/search
+ /search https://example.github.io/cat/pattern#tabby -
/cat/pattern
+ /cat/pattern https://example.github.io/README.md -
/README.md
+ /README.md @@ -316,21 +316,21 @@ The API returns an empty string if the port is the default for the scheme. URL -
URL.port
+ URL.port https://example.com -
// empty string
+ // empty string https://example.com:443/foo -
// empty string: port is default for scheme
+ // empty string: port is default for scheme https://www.example.com:1234/foo -
1234
+ 1234 @@ -361,8 +361,7 @@ The part of the URL (before `://`) that defines the [network protocol](https://developer.mozilla.org/docs/Glossary/Protocol) (or action to be taken by the user agent) when a request is made to a URL. For example, a request to a URL with an `https` scheme should be made using the [HTTPS protocol](https://en.wikipedia.org/wiki/HTTPS). For a request to a -URL with a scheme such as `file`, `mailto` or `git` that doesn't correspond to a network protocol, -the behaviour depends on the user agent. For example, when a user clicks on a `mailto` link, most +URL with a scheme such as `file`, `mailto` or `git` that doesn't correspond to a network protocol, behavior depends on the user agent. For example, when a user clicks on a `mailto` link, most browsers open their default email application, using the values in the link's `href` URL. - [Spec](https://url.spec.whatwg.org/#dom-url-protocol) @@ -370,24 +369,24 @@ browsers open their default email application, using the values in the link's `h ## Search (or "query string") -A series of key/value pairs that represent [parameters](#parameter), at the end of a URL after a -question mark. +A series of key/value pairs that represent [parameters](#parameter) and their values, at the end of +a URL after a question mark. - + - + - +
URLSearchURL.search
https://example.com/cats?pattern=tabby&mood=bonkerspattern=tabby&mood=bonkers?pattern=tabby&mood=bonkers
https://example.com/cats:443?pattern=tabbypattern=tabby?pattern=tabby
@@ -414,7 +413,7 @@ and the third-level domain is `example`. In this example, `com.au` is a subdomai [Site](https://html.spec.whatwg.org/multipage/browsers.html#sites) is defined by the HTML standard, along with [same-site](https://html.spec.whatwg.org/multipage/browsers.html#same-site), which [includes scheme](https://github.com/whatwg/url/issues/448), and -[schemeless same-site](https://html.spec.whatwg.org/multipage/browsers.html#schemelessly-same-site). | +[schemeless same-site](https://html.spec.whatwg.org/multipage/browsers.html#schemelessly-same-site). Site is not defined in the URL standard or the URL JavaScript API. In this context: @@ -452,11 +451,13 @@ In this context: Unlike [origin](#origin), site does not include [port](#port). {% Aside %} -The concept of "site" is important in terms of "same-site", as certain security restrictions -apply to subdomains that are considered "same-site" even if they are not "same-origin": +The concept of "site" is important in terms of "same-site", because certain security restrictions +apply to subdomains that are considered "same-site" even if they are not "same-origin". [Understanding "same-site" and "same-origin"](https://deploy-preview-9613--web-dev-staging.netlify.app/same-site-same-origin/) provides further information. {% endAside %} +- [Spec](https://html.spec.whatwg.org/multipage/browsers.html#sites) + ## Subdomain A domain within a higher-level domain. @@ -477,7 +478,7 @@ parts of the domain name before that. ## Top-level domain (TLD) A domain name listed in the [Root Zone Database](https://www.iana.org/domains/root/db) such as -`com`, `io` or `org`. Some top-level domains are [country code top-level domains](#cctld), +[`com`](https://www.iana.org/domains/root/db/com.html) or [`org`](https://www.iana.org/domains/root/db/org.html). Some top-level domains are [country code top-level domains](#cctld), such as [`uk`](https://www.iana.org/domains/root/db/uk.html) and [`tv`](https://www.iana.org/domains/root/db/tv.html).