Skip to content

Commit 29f61d8

Browse files
authored
Merge pull request #188 from Kong/fix/exceptions
fix common exceptions
2 parents 6c1092c + b43715e commit 29f61d8

File tree

3 files changed

+102
-96
lines changed

3 files changed

+102
-96
lines changed

lib/routes/bins/run.js

+4-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,9 @@ 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
34+
? encodeURIComponent(har.statusText)
35+
: "OK";
3436

3537
// special condition
3638
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",

src/static/main.css

+97-93
Original file line numberDiff line numberDiff line change
@@ -1,207 +1,211 @@
11
* {
2-
-webkit-font-smoothing: antialiased;
3-
-moz-osx-font-smoothing: grayscale;
2+
-webkit-font-smoothing: antialiased;
3+
-moz-osx-font-smoothing: grayscale;
44
}
55

66
body {
7-
color: #36434C;
8-
font-family: 'Open Sans', helvetica, sans-serif;
7+
color: #36434c;
8+
font-family: "Open Sans", helvetica, sans-serif;
99

10-
padding-bottom: 40px;
10+
padding-bottom: 40px;
1111
}
1212

13-
code, kbd, pre, samp {
14-
background-color: #FFFFFF;
15-
font-family: 'Source Code Pro', Menlo, Monaco, Consolas, 'Courier New', monospace;
13+
code,
14+
kbd,
15+
pre,
16+
samp {
17+
background-color: #ffffff;
18+
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "Courier New",
19+
monospace;
1620
}
1721

1822
#preview {
19-
position: relative;
23+
position: relative;
2024

21-
border-radius: 4px;
22-
border: 1px solid #C7C7C7;
23-
border: 1px solid rgba(0, 0, 0, .22);
24-
background-color: #FFFFFF;
25+
border-radius: 4px;
26+
border: 1px solid #c7c7c7;
27+
border: 1px solid rgba(0, 0, 0, 0.22);
28+
background-color: #ffffff;
2529

26-
box-shadow: 1px 0px 3px rgba(0, 0, 0, .15);
30+
box-shadow: 1px 0px 3px rgba(0, 0, 0, 0.15);
2731

28-
-moz-background-clip: padding;
29-
-webkit-background-clip: padding-box;
30-
background-clip: padding-box;
32+
-moz-background-clip: padding;
33+
-webkit-background-clip: padding-box;
34+
background-clip: padding-box;
3135
}
3236

3337
#preview header {
34-
height: 50px;
35-
border-bottom: 1px solid #EAEAEA;
36-
background-color: #FCFCFC;
37-
border-top-left-radius: 4px;
38-
border-top-right-radius: 4px;
38+
height: 50px;
39+
border-bottom: 1px solid #eaeaea;
40+
background-color: #fcfcfc;
41+
border-top-left-radius: 4px;
42+
border-top-right-radius: 4px;
3943
}
4044

4145
#preview .nav-tabs {
42-
border: 0;
43-
height: 51px;
44-
position: absolute;
46+
border: 0;
47+
height: 51px;
48+
position: absolute;
4549
}
4650

4751
#preview .nav-tabs > li {
48-
margin-bottom: 0;
52+
margin-bottom: 0;
4953
}
5054

5155
#preview .nav-tabs > li a,
5256
#preview .nav-tabs > li a:focus {
53-
border-top: none;
54-
border-bottom: none;
55-
border-radius: 0;
57+
border-top: none;
58+
border-bottom: none;
59+
border-radius: 0;
5660

57-
color: #8C9093;
58-
font-size: 13px;
59-
font-weight: 600;
61+
color: #8c9093;
62+
font-size: 13px;
63+
font-weight: 600;
6064

61-
padding: 16px;
62-
margin-right: 0;
65+
padding: 16px;
66+
margin-right: 0;
6367
}
6468

6569
#preview .nav-tabs > li:not(.active) a:hover {
66-
color: #41484C;
67-
background-color: #FCFCFC;
70+
color: #41484c;
71+
background-color: #fcfcfc;
6872
}
6973

7074
#preview .nav-tabs .open > a {
71-
border-color: #E6E6E6;
72-
background-color: #FCFCFC;
75+
border-color: #e6e6e6;
76+
background-color: #fcfcfc;
7377
}
7478

7579
#preview .nav-tabs {
76-
border-top-left-radius: 4px;
77-
border-top-right-radius: 4px;
80+
border-top-left-radius: 4px;
81+
border-top-right-radius: 4px;
7882
}
7983

8084
#preview .nav-tabs > li:first-of-type > a {
81-
border-left: none;
82-
border-top-left-radius: 4px;
85+
border-left: none;
86+
border-top-left-radius: 4px;
8387
}
8488

8589
#preview .nav-tabs > li.active > a,
8690
#preview .nav-tabs > li.active > a:focus,
8791
#preview .nav-tabs > li.active > a:hover {
88-
color: #216FA6;
89-
border-color: #E6E6E6;
92+
color: #216fa6;
93+
border-color: #e6e6e6;
9094
}
9195

92-
9396
#preview .tab-content .tab-pane,
9497
#preview .tab-content .tab-pane pre,
9598
#preview .tab-content .tab-pane pre code {
96-
height: 100%;
99+
height: 100%;
97100

98-
white-space: pre;
99-
word-break: normal;
100-
word-wrap: normal;
101+
white-space: pre;
102+
word-break: normal;
103+
word-wrap: normal;
101104
}
102105

103106
#preview .tab-content .tab-pane .btn-clipboard {
104-
position: absolute;
105-
top: 13px;
106-
right: 12px;
107+
position: absolute;
108+
top: 13px;
109+
right: 12px;
107110

108-
border-color: #D7D9DB;
111+
border-color: #d7d9db;
109112

110-
color: #399ee5;
111-
font-size: 11px;
112-
font-weight: 600;
113+
color: #399ee5;
114+
font-size: 11px;
115+
font-weight: 600;
113116

114-
padding: 3px 7px;
117+
padding: 3px 7px;
115118

116-
background: #F7F7F7;
117-
background: -moz-linear-gradient(0deg, #F7F7F7 0%, #FFFFFF 100%);
118-
background: -webkit-linear-gradient(0deg, #F7F7F7 0%, #FFFFFF 100%);
119-
background: -o-linear-gradient(0deg, #F7F7F7 0%, #FFFFFF 100%);
120-
background: -ms-linear-gradient(0deg, #F7F7F7 0%, #FFFFFF 100%);
121-
background: linear-gradient(0deg, #F7F7F7 0%, #FFFFFF 100%);
119+
background: #f7f7f7;
120+
background: -moz-linear-gradient(0deg, #f7f7f7 0%, #ffffff 100%);
121+
background: -webkit-linear-gradient(0deg, #f7f7f7 0%, #ffffff 100%);
122+
background: -o-linear-gradient(0deg, #f7f7f7 0%, #ffffff 100%);
123+
background: -ms-linear-gradient(0deg, #f7f7f7 0%, #ffffff 100%);
124+
background: linear-gradient(0deg, #f7f7f7 0%, #ffffff 100%);
122125
}
123126

124127
#preview pre {
125-
margin: 0;
126-
padding: 0;
128+
margin: 0;
129+
padding: 0;
127130

128-
max-height: 300px;
131+
max-height: 300px;
129132

130-
border: none;
131-
border-radius: 4px;
133+
border: none;
134+
border-radius: 4px;
132135

133-
background-color: #FFFFFF;
136+
background-color: #ffffff;
134137
}
135138

136139
#preview .hljs {
137-
padding: 15px;
138-
border-radius: 4px;
139-
background-color: #FFFFFF;
140+
padding: 15px;
141+
border-radius: 4px;
142+
background-color: #ffffff;
140143
}
141144

142145
div[data-page="bin/create"] .form-inline .form-group {
143-
margin-bottom: 15px;
146+
margin-bottom: 15px;
144147
}
145148

146149
div[data-page="bin/create"] .input-group.multi > .form-control {
147-
width: 50%;
150+
width: 50%;
148151
}
149152

150153
div[data-page="bin/create"] .input-group.multi > .form-control:last-of-type {
151-
margin-left: -1px;
154+
margin-left: -1px;
152155
}
153156

154157
div[data-page="bin/create"] .pair:last-of-type .btn-danger {
155-
display: none;
158+
display: none;
156159
}
157160

158161
div[data-page="bin/create"] .pair .btn-success {
159-
border-top-right-radius: 4px !important;
160-
border-bottom-right-radius: 4px !important;
162+
border-top-right-radius: 4px !important;
163+
border-bottom-right-radius: 4px !important;
161164
}
162165

163166
div[data-page="bin/create"] .pair:not(:last-of-type) .btn-success {
164-
display: none;
167+
display: none;
165168
}
166169

167170
div[data-page="bin/create"] code {
168-
min-height: 400px;
171+
min-height: 400px;
169172
}
170173

171174
div[data-page="bin/view"] .btn-block {
172-
text-align: left;
175+
text-align: left;
173176
}
174177

175178
div[data-page="bin/log"] h3 {
176-
margin-top: 0;
179+
margin-top: 0;
177180
}
178181

179182
div[data-page="bin/log"] pre {
180-
height: 500px;
183+
height: 500px;
181184

182-
overflow: auto;
185+
overflow: auto;
183186
}
184187

185188
div[data-page="bin/log"] tr[data-id] td {
186-
cursor: pointer;
187-
font-family: 'Source Code Pro', Menlo, Monaco, Consolas, 'Courier New', monospace;
189+
cursor: pointer;
190+
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "Courier New",
191+
monospace;
188192
}
189193

190194
div[data-page="bin/log"] tr.data td {
191-
display: none;
195+
display: none;
192196
}
193197

194198
div[data-page="bin/log"] tr.data:target td {
195-
display: table-cell;
199+
display: table-cell;
196200
}
197201

198202
.table {
199-
table-layout: fixed;
200-
white-space: nowrap;
203+
table-layout: fixed;
204+
white-space: nowrap;
201205
}
202206

203207
.table td {
204-
white-space: nowrap;
205-
overflow: hidden;
206-
text-overflow: ellipsis;
208+
white-space: nowrap;
209+
overflow: hidden;
210+
text-overflow: ellipsis;
207211
}

0 commit comments

Comments
 (0)