This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Commit d528b3f
fix: fix content-type by doing a fall-back using extensions (#1482)
The JS IPFS gateway was only responding with the correct content-type for some mime-types, see https://github.com/sindresorhus/file-type#supported-file-types.
This commit now fall-backs to detecting based on the extension as well.
Note that SVGs aren't supported by the `file-type` module.1 parent 5e80ee3 commit d528b3f
File tree
4 files changed
+185
-22
lines changed- src/http/gateway/resources
- test/gateway
- test-folder/unsniffable-folder
4 files changed
+185
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
15 | 30 | | |
16 | 31 | | |
17 | 32 | | |
| |||
97 | 112 | | |
98 | 113 | | |
99 | 114 | | |
100 | | - | |
| 115 | + | |
101 | 116 | | |
102 | 117 | | |
103 | 118 | | |
| |||
108 | 123 | | |
109 | 124 | | |
110 | 125 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
121 | 130 | | |
122 | 131 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 132 | + | |
127 | 133 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
133 | 137 | | |
| 138 | + | |
| 139 | + | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
116 | 134 | | |
117 | 135 | | |
118 | 136 | | |
| |||
166 | 184 | | |
167 | 185 | | |
168 | 186 | | |
169 | | - | |
| 187 | + | |
170 | 188 | | |
171 | 189 | | |
172 | 190 | | |
| |||
184 | 202 | | |
185 | 203 | | |
186 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
187 | 233 | | |
188 | 234 | | |
189 | 235 | | |
| |||
Lines changed: 56 additions & 0 deletions
Loading
Loading
0 commit comments