You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/http-gateways/web-redirects-file.md
+22-6
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Web _redirects File Specification
3
3
description: >
4
4
Defines how URL redirects and rewrites can be implemented by adding rules to
5
5
a plain text file stored underneath the root CID of a website.
6
-
date: 2023-01-28
6
+
date: 2023-11-09
7
7
maturity: reliable
8
8
editors:
9
9
- name: Justin Johnson
@@ -75,7 +75,11 @@ For example:
75
75
76
76
This rule will redirect a URL like `/posts/06/15/2022/hello-world` to `/articles/2022/06/15/hello-world`.
77
77
78
-
### Splat
78
+
Implementation MUST error when the same placeholder name is used more than once in `from`.
79
+
80
+
Implementation MUST allow the same placeholder name to be used more than once in `to`.
81
+
82
+
### Catch-All Splat
79
83
80
84
If a `from` path ends with an asterisk (i.e. `*`), the remainder of the `from` path is slurped up into the special `:splat` placeholder, which can then be injected into the `to` path.
81
85
@@ -91,7 +95,7 @@ Splat logic MUST only apply to a single trailing asterisk, as this is a greedy m
91
95
92
96
### Comments
93
97
94
-
Any line beginning with `#`will be treated as a comment and ignored at evaluation time.
98
+
Any line beginning with `#`MUST be treated as a comment and ignored at evaluation time.
95
99
96
100
For example:
97
101
@@ -108,17 +112,29 @@ is functionally equivalent to
108
112
109
113
### Line Termination
110
114
111
-
Lines MUST be terminated by either `\n` or `\r\n`.
115
+
Lines MUST be separated from each other by either `\n` or `\r\n`.
116
+
117
+
Termination of the last line in the file is optional.
118
+
119
+
### Whitespace Characters
120
+
121
+
Blank lines, leading and trailing whitespace characters like `\x20` (space) or
122
+
`\t` (tab) MUST be ignored, aside from the line termination mentioned above.
112
123
113
124
### Max File Size
114
125
115
126
The file size MUST NOT exceed 64 KiB.
116
127
117
128
# Evaluation
118
129
119
-
## Subdomain or DNSLink Gateways
130
+
## Same-Origin Requirement
131
+
132
+
Rules MUST only be evaluated in contexts where
133
+
[Same-Origin](https://en.wikipedia.org/wiki/Same-origin_policy) isolation per
134
+
root CID is possible.
120
135
121
-
Rules MUST only be evaluated when hosted on a Subdomain or DNSLink Gateway, so that we have [Same-Origin](https://en.wikipedia.org/wiki/Same-origin_policy) isolation.
136
+
This requirement is fulfilled on a Subdomain or DNSLink HTTP Gateway,
137
+
and also applies to a web browser with native `ipfs://` and `ipns://` scheme handler.
0 commit comments