braid-http 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/braid-http-client.js +3 -1
- package/braid-http-server.js +3 -1
- package/package.json +1 -1
package/braid-http-client.js
CHANGED
|
@@ -140,10 +140,12 @@ if (is_nodejs) {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
async function braid_fetch (url, params = {}) {
|
|
143
|
+
params = {...params} // Copy params, because we'll mutate it
|
|
144
|
+
|
|
143
145
|
// Initialize the headers object
|
|
144
146
|
if (!params.headers)
|
|
145
147
|
params.headers = new Headers()
|
|
146
|
-
|
|
148
|
+
else
|
|
147
149
|
params.headers = new Headers(params.headers)
|
|
148
150
|
|
|
149
151
|
// Always set the peer
|
package/braid-http-server.js
CHANGED
|
@@ -249,7 +249,9 @@ function braidify (req, res, next) {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
// Check the Useragent to work around Firefox bugs
|
|
252
|
-
if (req.headers['user-agent']
|
|
252
|
+
if (req.headers['user-agent']
|
|
253
|
+
&& typeof req.headers['user-agent'] === 'string'
|
|
254
|
+
&& req.headers['user-agent'].toLowerCase().indexOf('firefox') > -1)
|
|
253
255
|
res.is_firefox = true
|
|
254
256
|
|
|
255
257
|
next && next()
|