Skip to content

Commit e2dfdc9

Browse files
committed
fix common exceptions
1 parent 6c1092c commit e2dfdc9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/routes/bins/run.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = (client) => (req, res, next) => {
1919

2020
// headers
2121
har.headers.map((header) => {
22-
res.set(header.name, header.value);
22+
res.set(header.name.trim(), header.value);
2323
});
2424

2525
// cookies
@@ -30,7 +30,7 @@ module.exports = (client) => (req, res, next) => {
3030
// status
3131
res.httpVersion = har.httpVersion.split("/")[1];
3232
res.statusCode = har.status || 200;
33-
res.statusMessage = har.statusText || "OK";
33+
res.statusMessage = har.statusText ? encodeURIComponent(har.statusText) : "OK";
3434

3535
// special condition
3636
if (har.redirectURL !== "") {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"scripts": {
3333
"start": "node server.js",
34-
"dev": "npx nodemon -e pug,js,json server.js",
34+
"dev": "node --watch server.js",
3535
"test": "mocha --recursive",
3636
"check": "biome check .",
3737
"coverage": "npx nyc --report-dir coverage npm test",

0 commit comments

Comments
 (0)