Skip to content

Commit

Permalink
Some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Aug 19, 2024
1 parent 2385148 commit 0cc7819
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 37 deletions.
12 changes: 6 additions & 6 deletions files/en-us/web/uri/authority/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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&[email protected]`
- `https://cnn.example.com&[email protected]`
- : 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
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/uri/fragment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
32 changes: 2 additions & 30 deletions files/en-us/web/uri/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")}}
Expand Down Expand Up @@ -55,34 +55,7 @@ http://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2#SomewhereI

![Protocol]([email protected])

`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.

Expand Down Expand Up @@ -138,4 +111,3 @@ mailto:[email protected]
## 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)
1 change: 1 addition & 0 deletions files/en-us/web/uri/schemes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 0cc7819

Please sign in to comment.