mockaton 13.4.0 → 13.4.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mockaton",
3
3
  "description": "HTTP Mock Server",
4
4
  "type": "module",
5
- "version": "13.4.0",
5
+ "version": "13.4.2",
6
6
  "exports": {
7
7
  ".": {
8
8
  "import": "./index.js",
@@ -119,12 +119,12 @@ header {
119
119
 
120
120
  .Logo {
121
121
  align-self: end;
122
- margin-right: 22px;
123
- margin-bottom: 3px;
122
+ margin-right: 18px;
123
+ margin-bottom: 2px;
124
124
  transition: opacity 240ms ease-in-out;
125
125
 
126
126
  svg {
127
- width: 120px;
127
+ width: 122px;
128
128
  pointer-events: none;
129
129
  fill: var(--colorText);
130
130
  }
@@ -185,6 +185,7 @@ header {
185
185
  }
186
186
 
187
187
  .HelpLink {
188
+ opacity: 0.8;
188
189
  width: 22px;
189
190
  height: 22px;
190
191
  flex-shrink: 0;
@@ -197,6 +198,7 @@ header {
197
198
 
198
199
  &:hover {
199
200
  background: var(--colorAccent);
201
+ opacity: 1;
200
202
  }
201
203
 
202
204
  svg {
@@ -2,10 +2,10 @@ import { createSvgElement as s } from './utils/dom.js'
2
2
 
3
3
 
4
4
  export const Logo = () =>
5
- s('svg', { viewBox: '0 0 556 100' },
6
- s('path', { d: 'm13.75 1.8789c-5.9487 0.19352-10.865 4.5652-11.082 11.686v81.445c-1e-7 2.216 1.784 4 4 4h4.793c2.216 0 4-1.784 4-4v-64.982c0.02794-3.4488 3.0988-3.5551 4.2031-1.1562l16.615 59.059c1.4393 5.3711 5.1083 7.9633 8.7656 7.9473 3.6573 0.01603 7.3263-2.5762 8.7656-7.9473l16.615-59.059c1.1043-2.3989 4.1752-2.2925 4.2031 1.1562v64.982c0 2.216 1.784 4 4 4h4.793c2.216 0 4-1.784 4-4v-81.445c-0.17732-7.0807-5.1334-11.492-11.082-11.686-5.9487-0.19352-12.652 3.8309-15.609 13.619l-15.686 57.334-15.686-57.334c-2.9569-9.7882-9.6607-13.813-15.609-13.619zm239.19 0.074219c-2.216 0-4 1.784-4 4v89.057c0 2.216 1.784 4 4 4h4.793c2.216 0 3.9868-1.784 4-4l0.10644-17.94c0.0734-0.07237 12.175-13.75 12.175-13.75 5.6772 11.091 11.404 22.158 17.113 33.232 1.0168 1.9689 3.4217 2.7356 5.3906 1.7188l4.2578-2.1992c1.9689-1.0168 2.7356-3.4217 1.7188-5.3906-6.4691-12.585-12.958-25.16-19.442-37.738l17.223-19.771c1.4555-1.671 1.2803-4.189-0.39062-5.6445l-3.6133-3.1465c-0.73105-0.63679-1.6224-0.96212-2.5176-0.98633-1.151-0.03113-2.3063 0.43508-3.125 1.375l-28.896 33.174v-51.99c0-2.216-1.784-4-4-4zm-58.255 23.316c-10.699 0-19.312 8.6137-19.312 19.312v34.535c0 10.699 8.6137 19.312 19.312 19.312h19.717c10.699 0 19.311-8.6137 19.311-19.312l-0.125-7.8457c0-2.216-1.784-4-4-4h-4.6524c-2.216 0-4 1.784-4 4l3e-3 6.7888c3e-3 3.8063-1.5601 9.3694-8.4716 9.3694h-15.846c-6.9115 0-8.4766-5.5631-8.4766-12.475v-26.209c0-6.9115 1.5651-12.477 8.4766-12.477h15.846c6.6937 0 8.3697 5.2207 8.4687 11.828v2.2207c0 2.216 1.784 4 4 4h4.6524c2.216 0 4-1.784 4-4l0.125-5.7363c0-10.699-8.6117-19.312-19.311-19.312zm-72.182 0c-10.699 0-19.312 8.6137-19.312 19.312v34.535c0 10.699 8.6137 19.312 19.312 19.312h19.717c10.699 0 19.311-8.6137 19.311-19.312v-34.535c0-10.699-8.6117-19.312-19.311-19.312zm1.9356 11h15.846c6.9115 0 8.4746 5.5651 8.4746 12.477v26.209c0 6.9115-1.5631 12.475-8.4746 12.475h-15.846c-6.9115 0-8.4766-5.5631-8.4766-12.475v-26.209c0-6.9115 1.5651-12.477 8.4766-12.477z' }),
7
- s('path', { fill: 'currentColor', d: 'm331.9 25.27c-10.699 0-19.312 8.6137-19.312 19.312v4.3682c0 2.216 1.784 4 4 4h4.7715c2.216 0 4-1.784 4-4v-0.20414c0-6.9115 1.5651-12.477 8.4766-12.477h15.846c6.9115 0 8.4746 5.5651 8.4746 12.477v7.0148h-28.059c-10.699 0-19.312 8.6117-19.312 19.311v4.0477c0 10.699 8.6137 19.313 19.312 19.312h17.812c2.216-1e-6 4-1.784 4-4v-4.7715c0-2.216-1.784-4-4-4h-13.648c-6.9115-2e-5 -12.477-1.5651-12.477-8.5649 0-6.9998 5.5651-8.5629 12.477-8.5629h23.895v25.897c0 2.216 1.784 4 4 4h4.7715c2.216-1e-6 4-1.784 4-4v-49.848c0-10.699-8.6117-19.312-19.311-19.312z' }),
8
- s('path', { d: 'm392.75 1.373c-2.216 0-4 1.784-4 4v18.043h-5.3086c-2.216 0-4 1.784-4 4v4.793c0 2.216 1.784 4 4 4h5.3086v51.398c0 6.1465 3.7064 10.823 9.232 10.823h16.531c2.216 0 4-1.784 4-4v-4.793c0-2.216-1.784-4-4-4h-12.97v-49.428h9.8711c2.216 0 4-1.784 4-4v-4.793c0-2.216-1.784-4-4-4h-9.8711v-18.043c0-2.216-1.784-4-4-4zm122.96 23.896c-10.699 0-19.312 8.6137-19.312 19.312v49.812c0 2.216 1.784 4 4 4h4.7715c2.216 0 4-1.784 4-4v-45.648c0-6.9115 1.5651-12.477 8.4766-12.477h15.846c6.9115 0 8.4746 5.5651 8.4746 12.477v45.684c0 2.216 1.784 4 4 4h4.7715c2.216-1e-6 4-1.784 4-4v-49.848c0-10.699-8.6117-19.312-19.311-19.312zm-69.999 0c-10.699 0-19.312 8.6137-19.312 19.312v34.535c0 10.699 8.6137 19.312 19.312 19.312h19.717c10.699 0 19.311-8.6137 19.311-19.312v-34.535c0-10.699-8.6117-19.312-19.311-19.312zm1.9356 11h15.846c6.9115 0 8.4746 5.5651 8.4746 12.477v26.209c0 6.9115-1.5631 12.475-8.4746 12.475h-15.846c-6.9115 0-8.4766-5.5631-8.4766-12.475v-26.209c0-6.9115 1.5651-12.477 8.4766-12.477z' }))
5
+ s('svg', { viewBox: '0 0 460 80' },
6
+ s('path', { d: 'm332 29v34.9q0 2.5 1.06 3.84t4.51 1.34h2.5q3.74 0 3.55 4.42 0 4.51-3.55 4.51h-3.17q-3.07 0-5.76-0.768-2.69-0.864-5.18-2.4v0.096q-4.7-3.07-4.7-10.9v-35h-3.74q-3.46 0-3.65-4.51 0-4.51 3.65-4.51h3.74v-10.3q0-4.61 5.47-4.61 5.28 0 5.28 4.61v10.3h7.97q3.74 0 3.55 4.51 0 4.51-3.55 4.51zm50.9-9.02q2.5 0 5.09 1.06 2.69 1.06 5.18 2.69h-0.096q2.5 1.82 3.84 4.8 1.34 2.88 1.34 6.72v27.3q0 7.87-5.18 11.6-5.09 3.65-10.2 3.65h-15.4q-2.5 0-5.09-0.864t-5.09-2.78q-5.18-3.65-5.18-11.6v-27.3q0-3.84 1.34-6.72 1.34-2.98 3.84-4.8h-0.096q2.4-1.63 5.09-2.69t5.18-1.06zm-1.73 48.8q3.55 0 4.99-2.02 1.54-2.02 1.54-4.32v-27.1q0-2.4-1.54-4.32-1.44-2.02-4.99-2.02h-11.9q-3.55 0-5.09 2.02-1.44 1.92-1.44 4.32v27.1q0 2.3 1.44 4.32 1.54 2.02 5.09 2.02zm40 4.99q0 4.61-5.28 4.61t-5.28-4.61v-38.6q0-3.94 1.25-6.82t3.94-4.7q5.09-3.65 10.2-3.65h15.5q4.9 0 10.2 3.65 5.18 3.65 5.18 11.5v38.6q0 4.61-5.28 4.61t-5.28-4.61v-37.7q0-2.5-1.54-4.8l0.096 0.096q-1.25-2.3-5.09-2.3h-12q-3.94 0-5.18 2.3-1.34 2.02-1.34 4.7z' }),
7
+ s('path', { fill: 'currentColor', d: 'm282 11-21 64.5v-0.096q-0.576 1.44-1.63 2.4-0.96 0.864-2.4 0.864-0.768 0-1.54-0.192-0.672-0.096-1.44-0.288h0.096q-5.47-1.73-4.03-6.14l21.9-66.5q0.48-1.54 1.63-2.59 1.25-1.06 2.88-1.25 1.63-0.288 3.17-0.384 1.54-0.192 2.4-0.192t2.4 0.192q1.54 0.096 3.17 0.288 1.34 0.192 2.59 1.44 1.34 1.25 2.02 2.5 5.38 16.5 10.8 33.3 5.57 16.7 10.9 33.2 1.34 4.42-4.03 6.14-0.768 0.192-1.44 0.288-0.576 0.192-1.34 0.192-1.34 0-2.5-0.864-1.06-0.96-1.54-2.4v0.096zm7.2 43.8q0 3.07-2.21 5.28-2.11 2.11-5.18 2.11t-5.18-2.11q-2.11-2.21-2.11-5.28t2.11-5.18q2.11-2.21 5.18-2.21t5.18 2.21q2.21 2.11 2.21 5.18z' }),
8
+ s('path', { d: 'm31.4 36q0-1.25-0.384-2.4-0.384-1.25-0.96-2.3-1.25-2.3-5.18-2.3h-6.14q-3.94 0-5.28 2.3-1.15 2.21-1.15 4.7v38q0 4.51-5.28 4.51-5.47 0-5.47-4.51v-38.9q0-7.87 5.18-11.5 5.28-3.65 10.3-3.65h9.7q2.21 0 4.9 0.864t5.18 2.69q2.4-1.82 4.99-2.69 2.69-0.864 5.09-0.864h9.6q5.09 0 10.2 3.65 5.28 3.55 5.28 11.5v38.9q0 4.51-5.38 4.51t-5.38-4.51v-38q0-1.25-0.288-2.5t-1.06-2.3l0.096 0.096q-0.768-1.25-1.92-1.73-1.15-0.576-3.36-0.576h-6.05q-4.03 0-5.28 2.3-1.25 2.11-1.25 4.7v38q0 4.51-5.28 4.51-5.38 0-5.38-4.51zm83.2-16q2.5 0 5.09 1.06 2.69 1.06 5.18 2.69h-0.096q2.5 1.82 3.84 4.8 1.34 2.88 1.34 6.72v27.3q0 7.87-5.18 11.6-5.09 3.65-10.2 3.65h-15.4q-2.5 0-5.09-0.864t-5.09-2.78q-5.18-3.65-5.18-11.6v-27.3q0-3.84 1.34-6.72 1.34-2.98 3.84-4.8h-0.096q2.4-1.63 5.09-2.69t5.18-1.06zm-1.73 48.8q3.55 0 4.99-2.02 1.54-2.02 1.54-4.32v-27.1q0-2.4-1.54-4.32-1.44-2.02-4.99-2.02h-11.9q-3.55 0-5.09 2.02-1.44 1.92-1.44 4.32v27.1q0 2.3 1.44 4.32 1.54 2.02 5.09 2.02zm75.6-6.24q0 7.87-5.18 11.6-5.09 3.65-10.2 3.65h-16.1q-5.09 0-9.89-3.65-2.3-1.92-3.55-4.8-1.25-2.98-1.25-6.82v-27.4q0-7.78 4.8-11.5 2.4-1.73 4.9-2.69 2.59-1.06 4.99-1.06h16.1q2.3 0 5.09 0.96 2.78 0.864 5.18 2.4 2.3 1.63 3.65 4.51 1.44 2.88 1.44 6.82v4.8q0 4.61-5.28 4.61t-5.28-4.61v-4.13q0-2.4-1.54-4.32-1.44-2.02-4.99-2.02h-12q-3.55 0-5.09 2.02-1.44 1.92-1.44 4.32v27.2q0 2.3 1.44 4.32 1.54 2.02 5.09 2.02h12q3.55 0 4.99-2.02 1.54-2.02 1.54-4.32v-4.42q0-4.51 5.28-4.51t5.28 4.51zm22.8-0.768v12.2q0 4.51-5.28 4.51t-5.28-4.51v-68.4q0-4.61 5.28-4.61t5.28 4.61v40.7q2.4-2.88 5.28-6.14 2.98-3.36 5.86-6.72 2.98-3.46 5.86-6.72 2.88-3.36 5.38-6.24v0.096q1.73-2.02 3.46-2.02 0.96 0 1.82 0.48 0.96 0.384 2.02 1.15h-0.096q2.3 1.92 2.3 3.84 0 0.672-0.288 1.54-0.288 0.768-0.96 1.34zm32.1 9.6q0.672 1.25 0.672 2.59 0 2.5-2.88 3.74-1.92 1.15-3.46 1.15-1.06 0-2.02-0.768-0.96-0.672-1.54-1.73l-9.6-18.5q-0.864-1.44-0.864-2.88 0-2.4 2.5-4.03 0.672-0.48 1.34-0.864 0.768-0.384 1.63-0.576 1.06-0.192 2.02 0.384t1.63 1.54z' }))
9
9
 
10
10
  export const TimerIcon = () =>
11
11
  s('svg', { viewBox: '0 0 24 24' },
@@ -74,7 +74,7 @@ function request(path, options = {}) {
74
74
  class Fixture {
75
75
  constructor(file, body = '') {
76
76
  this.file = file
77
- this.body = body || `Body for ${file}`
77
+ this.body = body || `Body for: ${file}`
78
78
  const t = parseFilename(file)
79
79
  this.urlMask = t.urlMask
80
80
  this.method = t.method
@@ -336,7 +336,8 @@ describe('Proxy Fallback', () => {
336
336
  response.writeHead(423, {
337
337
  'custom_header': 'my_custom_header',
338
338
  'content-type': mimeFor('.json'),
339
- 'set-cookie': CUSTOM_COOKIES
339
+ 'set-cookie': CUSTOM_COOKIES,
340
+ 'cache-control': 'public'
340
341
  })
341
342
  response.end(JSON.stringify(BODY_PAYLOAD))
342
343
  })
@@ -359,6 +360,9 @@ describe('Proxy Fallback', () => {
359
360
 
360
361
  equal(r1.headers.get('set-cookie'), CUSTOM_COOKIES.join(', '))
361
362
  equal(r2.headers.get('set-cookie'), CUSTOM_COOKIES.join(', '))
363
+
364
+ equal(r1.headers.get('cache-control'), 'no-cache') // unsets cache
365
+ equal(r2.headers.get('cache-control'), 'no-cache')
362
366
 
363
367
  deepEqual(await r2.json(), BODY_PAYLOAD)
364
368
  deepEqual(await r1.json(), BODY_PAYLOAD)
@@ -34,7 +34,8 @@ export async function proxy(req, response, delay) {
34
34
 
35
35
  response.writeHead(proxyResponse.status, {
36
36
  ...Object.fromEntries(proxyResponse.headers),
37
- 'Set-Cookie': proxyResponse.headers.getSetCookie() // parses multiple into an array
37
+ 'set-cookie': proxyResponse.headers.getSetCookie(), // parses multiple into an array
38
+ 'cache-control': 'no-cache'
38
39
  })
39
40
  const body = await proxyResponse.text()
40
41
  setTimeout(() => response.end(body), delay) // TESTME