Commit 46e71ac
committed
Add a setting to disallow HTTP to HTTPS redirects
Mirrorbits doens't respect the incoming protocol *strictly*, instead the
behavior is as such:
- HTTPS request: HTTPS redirect
- HTTP request: HTTP or HTTPS redirect
So it doesn't try to respect the HTTP protocol, and is happy to redirect
HTTP requests to HTTPS. Which makes sense if mirrorbits is meant to
serve files downloaded from a web browser, where HTTPS is the norm.
However for Linux distro, for a package repository, it's important to
respect the incoming protocol. There are minimal systems that don't have
HTTPS support out of the box. For Debian (and Debian-like), the standard
Docker image doesn't have CA certificates pre-installed, and apt is
configured to use HTTP repositories. The first command to run is `apt
update`, and if ever that gets redirected to HTTPS, apt fails.
With this commit, we can now change this behavior, and ask mirrorbits to
respect the protocol strictly. As a bonus point, having it in
mirrobits.conf allows to document a rather obscure (but important)
aspect of mirrorbits behavior.
Note that, by default, the setting is true, so the default behavior of
mirrorbits is still the same: redirect HTTP to HTTPS is allowed.1 parent c320c8d commit 46e71ac
3 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
70 | | - | |
71 | | - | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
0 commit comments