From 0cc78197f5d8286891a7066b4311ac8e98564c66 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Sun, 18 Aug 2024 21:20:54 -0400 Subject: [PATCH] Some changes --- files/en-us/web/uri/authority/index.md | 12 +++++----- files/en-us/web/uri/fragment/index.md | 2 +- files/en-us/web/uri/index.md | 32 ++------------------------ files/en-us/web/uri/schemes/index.md | 1 + 4 files changed, 10 insertions(+), 37 deletions(-) diff --git a/files/en-us/web/uri/authority/index.md b/files/en-us/web/uri/authority/index.md index c4866c35ec19dce..0827eb1cc944cb5 100644 --- a/files/en-us/web/uri/authority/index.md +++ b/files/en-us/web/uri/authority/index.md @@ -7,7 +7,7 @@ spec-urls: https://www.rfc-editor.org/rfc/rfc3986.html#section-3.1 {{QuickLinksWithSubpages("/en-US/docs/Web/URI")}} -The **authority** of a URI is the part of the URI that comes after the scheme and before the path. It consists of three parts: user information, host, and port. +The **authority** of a URI is the section that comes after the [scheme](/en-US/docs/Web/URI/Schemes) and before the path. It may have up to three parts: user information, host, and port. ## Syntax @@ -27,17 +27,17 @@ user@host:port - : The _user_ is optional and is used for authentication purposes. It is not commonly used in web URIs. > [!WARNING] - > Providing user information directly in the URI is not recommended, as it can expose sensitive information. Use other methods like HTTP authentication or session cookies instead. Sometimes, phishing sites trick users by display misleading URLs whose "user" part appears as if it's a domain name, known as [semantic URL attack](https://en.wikipedia.org/wiki/Semantic_URL_attack). + > Providing user information directly in HTTP URLs is not recommended, as it can expose sensitive information. Use other methods like HTTP authentication or session cookies instead. Sometimes, phishing sites trick users by display misleading URLs whose "user" part appears as if it's a domain name, known as [semantic URL attack](https://en.wikipedia.org/wiki/Semantic_URL_attack). ## Examples -- `developer.mozilla.org` +- `https://developer.mozilla.org` - : The host is `developer.mozilla.org`. The port is not specified but will default to 443 if accessed via `https:`. -- `localhost:8080` +- `http://localhost:8080` - : The host is `localhost` and the port is `8080`. `localhost` is a special host name that the browser resolves to the local address `127.0.0.1`. -- `postgres:admin123@db:5432` +- `postgresql://postgres:admin123@db:5432` - : The host is `db`, and the port is `5432`. It also specifies a user `postgres` and its password `admin123`. This can be used to connect to a PostgreSQL database. -- `cnn.example.com&story=breaking_news@10.0.0.1` +- `https://cnn.example.com&story=breaking_news@10.0.0.1` - : A misleading URL that looks like it's pointing to a trusted website. However, the host name is `10.0.0.1`, and the `cnn.example.com&story=breaking_news` part is the "user". ## See also diff --git a/files/en-us/web/uri/fragment/index.md b/files/en-us/web/uri/fragment/index.md index 136b778c7ed33c8..4e6f8f0546bdbd0 100644 --- a/files/en-us/web/uri/fragment/index.md +++ b/files/en-us/web/uri/fragment/index.md @@ -28,7 +28,7 @@ The **fragment** of a URI is the last part of the URI, starting with the `#` cha - `#syntax` - : The browser will scroll to the element with the `id="syntax"` in the document (which, for this page, is the [Syntax](#syntax) heading). - `#:~:text=fragment` - - : The browser will highlight the text `fragment` in the document. + - : The browser will highlight the text [`fragment`](#:~:text=fragment) in the document. - `#t=10,20` - : The video or audio will start playing from the 10th second. diff --git a/files/en-us/web/uri/index.md b/files/en-us/web/uri/index.md index 4f15b2270f268ea..c204e988e890516 100644 --- a/files/en-us/web/uri/index.md +++ b/files/en-us/web/uri/index.md @@ -2,7 +2,7 @@ title: URIs slug: Web/URI page-type: guide -spec-urls: https://httpwg.org/specs/rfc9110.html#uri +spec-urls: https://www.rfc-editor.org/rfc/rfc3986.html --- {{QuickLinksWithSubpages("/en-US/docs/Web/URI")}} @@ -55,34 +55,7 @@ http://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2#SomewhereI ![Protocol](mdn-url-protocol@x2.png) -`http://` is the [_scheme_](/en-US/docs/Web/URI/Schemes) of the URL, indicating which protocol the browser must use. Usually it is the HTTP protocol or its secured version, HTTPS. The Web requires one of these two, but browsers also know how to handle other protocols such as `mailto:` (to open a mail client) or `ftp:` to handle a file transfer, so don't be surprised if you see such protocols. Common schemes are: - -- [`blob`](/en-US/docs/Web/API/URL/createObjectURL_static) - - : Binary Large Object; a pointer to a large in-memory object -- [`data`](/en-US/docs/Web/URI/Schemes/data) - - : Data directly embedded in the URL -- `file` - - : Host-specific file names -- `ftp` - - : {{Glossary("FTP","File Transfer Protocol")}} -- `http/https` - - : [Hyper text transfer protocol (Secure)](/en-US/docs/Glossary/HTTP) -- `javascript` - - : URL-embedded JavaScript code -- `mailto` - - : Electronic mail address -- [`resource`](/en-US/docs/Web/URI/Schemes/resource) {{Non-standard_inline}} - - : Firefox and Firefox browser extensions to load resources internally -- `ssh` - - : Secure shell -- `tel` - - : telephone -- `urn` - - : Uniform Resource Names -- `view-source` - - : Source code of the resource -- `ws/wss` - - : [WebSocket connections (Secure)](/en-US/docs/Web/API/WebSockets_API) +`http://` is the [_scheme_](/en-US/docs/Web/URI/Schemes) of the URL, indicating which protocol the browser must use. Usually it is the HTTP protocol or its secured version, HTTPS. The Web requires one of these two, but browsers also know how to handle other protocols such as `mailto:` (to open a mail client) or `ftp:` to handle a file transfer, so don't be surprised if you see such protocols. The [schemes](/en-US/docs/Web/URI/Schemes) reference provides a list of the most common schemes, and documentation for some of them. When using URLs in {{Glossary("HTML")}} content, you should generally only use a few of these URL schemes. When referring to subresources — that is, files that are being loaded as part of a larger document — you should only use the HTTP and HTTPS schemes. Increasingly, browsers are removing support for using FTP to load subresources, for security reasons. @@ -138,4 +111,3 @@ mailto:help@supercyberhelpdesk.info ## See also - [What is a URL?](/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL) -- [IANA list of URI schemes](https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml) diff --git a/files/en-us/web/uri/schemes/index.md b/files/en-us/web/uri/schemes/index.md index fb3dc5c9f249042..9ce08ec2b7ea59e 100644 --- a/files/en-us/web/uri/schemes/index.md +++ b/files/en-us/web/uri/schemes/index.md @@ -49,3 +49,4 @@ protocol: - [URIs](/en-US/docs/Web/URI) - [Data URLs](/en-US/docs/Web/URI/Schemes/data) - [Resource URLs](/en-US/docs/Web/URI/Schemes/resource) +- [IANA list of URI schemes](https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml)