Commit bb36028
authored
fix: allow requests from electron renderer (#201)
* fix: allow requests from electron renderer
The Electron Renderer process runs in an embedded browser window so
has access to browser-native `fetch`. If this is used by
`ipfs-http-client` to make requests against the HTTP API, the
`User-Agent` header is set to a value that looks similar to a browser
but no `Origin` or `Referer` headers are sent.
The change here is to relax the user agent check to allow through
requests from clients with `'Electron'` in their user agents.1 parent df39339 commit bb36028
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
179 | 186 | | |
180 | 187 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
206 | 215 | | |
207 | 216 | | |
208 | 217 | | |
| |||
0 commit comments