@st-gr/sail-proxy 0.9.2 → 0.9.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.
Files changed (213) hide show
  1. package/bundled/gateway/node_modules/.package-lock.json +132 -83
  2. package/bundled/gateway/node_modules/axios/CHANGELOG.md +0 -42
  3. package/bundled/gateway/node_modules/axios/README.md +237 -237
  4. package/bundled/gateway/node_modules/axios/dist/axios.js +21 -113
  5. package/bundled/gateway/node_modules/axios/dist/axios.js.map +1 -0
  6. package/bundled/gateway/node_modules/axios/dist/axios.min.js +2 -2
  7. package/bundled/gateway/node_modules/axios/dist/axios.min.js.map +1 -1
  8. package/bundled/gateway/node_modules/axios/dist/browser/axios.cjs +15 -121
  9. package/bundled/gateway/node_modules/axios/dist/browser/axios.cjs.map +1 -0
  10. package/bundled/gateway/node_modules/axios/dist/esm/axios.js +15 -121
  11. package/bundled/gateway/node_modules/axios/dist/esm/axios.js.map +1 -0
  12. package/bundled/gateway/node_modules/axios/dist/esm/axios.min.js +2 -2
  13. package/bundled/gateway/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  14. package/bundled/gateway/node_modules/axios/dist/node/axios.cjs +107 -249
  15. package/bundled/gateway/node_modules/axios/dist/node/axios.cjs.map +1 -0
  16. package/bundled/gateway/node_modules/axios/index.d.cts +3 -8
  17. package/bundled/gateway/node_modules/axios/index.d.ts +1 -4
  18. package/bundled/gateway/node_modules/axios/lib/adapters/fetch.js +0 -79
  19. package/bundled/gateway/node_modules/axios/lib/adapters/http.js +118 -62
  20. package/bundled/gateway/node_modules/axios/lib/core/Axios.js +0 -1
  21. package/bundled/gateway/node_modules/axios/lib/core/AxiosHeaders.js +2 -2
  22. package/bundled/gateway/node_modules/axios/lib/defaults/transitional.js +0 -1
  23. package/bundled/gateway/node_modules/axios/lib/env/data.js +1 -1
  24. package/bundled/gateway/node_modules/axios/lib/helpers/buildURL.js +1 -1
  25. package/bundled/gateway/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
  26. package/bundled/gateway/node_modules/axios/lib/helpers/resolveConfig.js +6 -12
  27. package/bundled/gateway/node_modules/axios/lib/helpers/toFormData.js +1 -1
  28. package/bundled/gateway/node_modules/axios/lib/utils.js +2 -23
  29. package/bundled/gateway/node_modules/axios/package.json +13 -29
  30. package/bundled/gateway/node_modules/body-parser/HISTORY.md +0 -14
  31. package/bundled/gateway/node_modules/body-parser/SECURITY.md +25 -0
  32. package/bundled/gateway/node_modules/body-parser/lib/types/json.js +5 -1
  33. package/bundled/gateway/node_modules/body-parser/lib/types/urlencoded.js +15 -7
  34. package/bundled/gateway/node_modules/body-parser/node_modules/qs/.editorconfig +46 -0
  35. package/bundled/gateway/node_modules/body-parser/node_modules/qs/.eslintrc +38 -0
  36. package/bundled/gateway/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml +12 -0
  37. package/bundled/gateway/node_modules/body-parser/node_modules/qs/.nycrc +13 -0
  38. package/bundled/gateway/node_modules/body-parser/node_modules/qs/CHANGELOG.md +600 -0
  39. package/bundled/gateway/node_modules/body-parser/node_modules/qs/LICENSE.md +29 -0
  40. package/bundled/gateway/node_modules/body-parser/node_modules/qs/README.md +709 -0
  41. package/bundled/gateway/node_modules/body-parser/node_modules/qs/dist/qs.js +90 -0
  42. package/bundled/gateway/node_modules/body-parser/node_modules/qs/lib/formats.js +23 -0
  43. package/bundled/gateway/node_modules/body-parser/node_modules/qs/lib/index.js +11 -0
  44. package/bundled/gateway/node_modules/body-parser/node_modules/qs/lib/parse.js +296 -0
  45. package/bundled/gateway/node_modules/body-parser/node_modules/qs/lib/stringify.js +351 -0
  46. package/bundled/gateway/node_modules/body-parser/node_modules/qs/lib/utils.js +265 -0
  47. package/bundled/gateway/node_modules/body-parser/node_modules/qs/package.json +91 -0
  48. package/bundled/gateway/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js +267 -0
  49. package/bundled/gateway/node_modules/body-parser/node_modules/qs/test/parse.js +1170 -0
  50. package/bundled/gateway/node_modules/body-parser/node_modules/qs/test/stringify.js +1298 -0
  51. package/bundled/gateway/node_modules/body-parser/node_modules/qs/test/utils.js +136 -0
  52. package/bundled/gateway/node_modules/body-parser/package.json +10 -9
  53. package/bundled/gateway/node_modules/cookie/index.js +35 -24
  54. package/bundled/gateway/node_modules/cookie/package.json +1 -1
  55. package/bundled/gateway/node_modules/cookie-signature/History.md +1 -5
  56. package/bundled/gateway/node_modules/cookie-signature/index.js +6 -6
  57. package/bundled/gateway/node_modules/cookie-signature/package.json +2 -2
  58. package/bundled/gateway/node_modules/express/History.md +0 -43
  59. package/bundled/gateway/node_modules/express/lib/response.js +0 -1
  60. package/bundled/gateway/node_modules/express/lib/utils.js +1 -2
  61. package/bundled/gateway/node_modules/express/node_modules/qs/.editorconfig +43 -0
  62. package/bundled/gateway/node_modules/express/node_modules/qs/.eslintrc +38 -0
  63. package/bundled/gateway/node_modules/express/node_modules/qs/.github/FUNDING.yml +12 -0
  64. package/bundled/gateway/node_modules/express/node_modules/qs/.nycrc +13 -0
  65. package/bundled/gateway/node_modules/express/node_modules/qs/CHANGELOG.md +546 -0
  66. package/bundled/gateway/node_modules/express/node_modules/qs/LICENSE.md +29 -0
  67. package/bundled/gateway/node_modules/express/node_modules/qs/README.md +625 -0
  68. package/bundled/gateway/node_modules/express/node_modules/qs/dist/qs.js +2054 -0
  69. package/bundled/gateway/node_modules/express/node_modules/qs/lib/formats.js +23 -0
  70. package/bundled/gateway/node_modules/express/node_modules/qs/lib/index.js +11 -0
  71. package/bundled/gateway/node_modules/express/node_modules/qs/lib/parse.js +263 -0
  72. package/bundled/gateway/node_modules/express/node_modules/qs/lib/stringify.js +326 -0
  73. package/bundled/gateway/node_modules/express/node_modules/qs/lib/utils.js +252 -0
  74. package/bundled/gateway/node_modules/express/node_modules/qs/package.json +77 -0
  75. package/bundled/gateway/node_modules/express/node_modules/qs/test/parse.js +855 -0
  76. package/bundled/gateway/node_modules/express/node_modules/qs/test/stringify.js +909 -0
  77. package/bundled/gateway/node_modules/express/node_modules/qs/test/utils.js +136 -0
  78. package/bundled/gateway/node_modules/express/package.json +17 -21
  79. package/bundled/gateway/node_modules/finalhandler/HISTORY.md +0 -21
  80. package/bundled/gateway/node_modules/finalhandler/README.md +2 -2
  81. package/bundled/gateway/node_modules/finalhandler/index.js +2 -7
  82. package/bundled/gateway/node_modules/finalhandler/node_modules/encodeurl/HISTORY.md +14 -0
  83. package/bundled/gateway/node_modules/finalhandler/node_modules/encodeurl/LICENSE +22 -0
  84. package/bundled/gateway/node_modules/finalhandler/node_modules/encodeurl/README.md +128 -0
  85. package/bundled/gateway/node_modules/finalhandler/node_modules/encodeurl/index.js +60 -0
  86. package/bundled/gateway/node_modules/finalhandler/node_modules/encodeurl/package.json +40 -0
  87. package/bundled/gateway/node_modules/finalhandler/package.json +9 -10
  88. package/bundled/gateway/node_modules/http-errors/HISTORY.md +0 -6
  89. package/bundled/gateway/node_modules/http-errors/index.js +3 -4
  90. package/bundled/gateway/node_modules/http-errors/package.json +8 -12
  91. package/bundled/gateway/node_modules/qs/CHANGELOG.md +0 -16
  92. package/bundled/gateway/node_modules/qs/README.md +1 -1
  93. package/bundled/gateway/node_modules/qs/dist/qs.js +15 -15
  94. package/bundled/gateway/node_modules/qs/eslint.config.mjs +0 -1
  95. package/bundled/gateway/node_modules/qs/lib/parse.js +24 -54
  96. package/bundled/gateway/node_modules/qs/lib/stringify.js +4 -11
  97. package/bundled/gateway/node_modules/qs/package.json +3 -3
  98. package/bundled/gateway/node_modules/qs/test/parse.js +0 -135
  99. package/bundled/gateway/node_modules/qs/test/stringify.js +0 -138
  100. package/bundled/gateway/node_modules/qs/test/utils.js +3 -31
  101. package/bundled/gateway/node_modules/raw-body/HISTORY.md +308 -0
  102. package/bundled/gateway/node_modules/raw-body/SECURITY.md +24 -0
  103. package/bundled/gateway/node_modules/raw-body/package.json +7 -5
  104. package/bundled/gateway/node_modules/send/HISTORY.md +7 -19
  105. package/bundled/gateway/node_modules/send/node_modules/encodeurl/HISTORY.md +14 -0
  106. package/bundled/gateway/node_modules/send/node_modules/encodeurl/LICENSE +22 -0
  107. package/bundled/gateway/node_modules/send/node_modules/encodeurl/README.md +128 -0
  108. package/bundled/gateway/node_modules/send/node_modules/encodeurl/index.js +60 -0
  109. package/bundled/gateway/node_modules/send/node_modules/encodeurl/package.json +40 -0
  110. package/bundled/gateway/node_modules/send/package.json +6 -6
  111. package/bundled/gateway/node_modules/serve-static/HISTORY.md +0 -16
  112. package/bundled/gateway/node_modules/serve-static/node_modules/encodeurl/HISTORY.md +14 -0
  113. package/bundled/gateway/node_modules/serve-static/node_modules/encodeurl/LICENSE +22 -0
  114. package/bundled/gateway/node_modules/serve-static/node_modules/encodeurl/README.md +128 -0
  115. package/bundled/gateway/node_modules/serve-static/node_modules/encodeurl/index.js +60 -0
  116. package/bundled/gateway/node_modules/serve-static/node_modules/encodeurl/package.json +40 -0
  117. package/bundled/gateway/node_modules/serve-static/package.json +3 -3
  118. package/bundled/gateway/node_modules/statuses/HISTORY.md +0 -5
  119. package/bundled/gateway/node_modules/statuses/README.md +0 -3
  120. package/bundled/gateway/node_modules/statuses/package.json +7 -7
  121. package/bundled/gateway/package-lock.json +137 -88
  122. package/bundled/gateway/package.json +23 -5
  123. package/bundled/ollama/node_modules/.package-lock.json +104 -85
  124. package/bundled/ollama/node_modules/axios/CHANGELOG.md +0 -42
  125. package/bundled/ollama/node_modules/axios/README.md +237 -237
  126. package/bundled/ollama/node_modules/axios/dist/axios.js +21 -113
  127. package/bundled/ollama/node_modules/axios/dist/axios.js.map +1 -0
  128. package/bundled/ollama/node_modules/axios/dist/axios.min.js +2 -2
  129. package/bundled/ollama/node_modules/axios/dist/axios.min.js.map +1 -1
  130. package/bundled/ollama/node_modules/axios/dist/browser/axios.cjs +15 -121
  131. package/bundled/ollama/node_modules/axios/dist/browser/axios.cjs.map +1 -0
  132. package/bundled/ollama/node_modules/axios/dist/esm/axios.js +15 -121
  133. package/bundled/ollama/node_modules/axios/dist/esm/axios.js.map +1 -0
  134. package/bundled/ollama/node_modules/axios/dist/esm/axios.min.js +2 -2
  135. package/bundled/ollama/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  136. package/bundled/ollama/node_modules/axios/dist/node/axios.cjs +107 -249
  137. package/bundled/ollama/node_modules/axios/dist/node/axios.cjs.map +1 -0
  138. package/bundled/ollama/node_modules/axios/index.d.cts +3 -8
  139. package/bundled/ollama/node_modules/axios/index.d.ts +1 -4
  140. package/bundled/ollama/node_modules/axios/lib/adapters/fetch.js +0 -79
  141. package/bundled/ollama/node_modules/axios/lib/adapters/http.js +118 -62
  142. package/bundled/ollama/node_modules/axios/lib/core/Axios.js +0 -1
  143. package/bundled/ollama/node_modules/axios/lib/core/AxiosHeaders.js +2 -2
  144. package/bundled/ollama/node_modules/axios/lib/defaults/transitional.js +0 -1
  145. package/bundled/ollama/node_modules/axios/lib/env/data.js +1 -1
  146. package/bundled/ollama/node_modules/axios/lib/helpers/buildURL.js +1 -1
  147. package/bundled/ollama/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
  148. package/bundled/ollama/node_modules/axios/lib/helpers/resolveConfig.js +6 -12
  149. package/bundled/ollama/node_modules/axios/lib/helpers/toFormData.js +1 -1
  150. package/bundled/ollama/node_modules/axios/lib/utils.js +2 -23
  151. package/bundled/ollama/node_modules/axios/package.json +13 -29
  152. package/bundled/ollama/node_modules/body-parser/HISTORY.md +0 -14
  153. package/bundled/ollama/node_modules/body-parser/SECURITY.md +25 -0
  154. package/bundled/ollama/node_modules/body-parser/lib/types/json.js +5 -1
  155. package/bundled/ollama/node_modules/body-parser/lib/types/urlencoded.js +15 -7
  156. package/bundled/ollama/node_modules/body-parser/package.json +10 -9
  157. package/bundled/ollama/node_modules/cookie/index.js +35 -24
  158. package/bundled/ollama/node_modules/cookie/package.json +1 -1
  159. package/bundled/ollama/node_modules/cookie-signature/History.md +1 -5
  160. package/bundled/ollama/node_modules/cookie-signature/index.js +6 -6
  161. package/bundled/ollama/node_modules/cookie-signature/package.json +2 -2
  162. package/bundled/ollama/node_modules/express/History.md +0 -43
  163. package/bundled/ollama/node_modules/express/lib/response.js +0 -1
  164. package/bundled/ollama/node_modules/express/lib/utils.js +1 -2
  165. package/bundled/ollama/node_modules/express/package.json +17 -21
  166. package/bundled/ollama/node_modules/finalhandler/HISTORY.md +0 -21
  167. package/bundled/ollama/node_modules/finalhandler/README.md +2 -2
  168. package/bundled/ollama/node_modules/finalhandler/index.js +2 -7
  169. package/bundled/ollama/node_modules/finalhandler/node_modules/encodeurl/HISTORY.md +14 -0
  170. package/bundled/ollama/node_modules/finalhandler/node_modules/encodeurl/LICENSE +22 -0
  171. package/bundled/ollama/node_modules/finalhandler/node_modules/encodeurl/README.md +128 -0
  172. package/bundled/ollama/node_modules/finalhandler/node_modules/encodeurl/index.js +60 -0
  173. package/bundled/ollama/node_modules/finalhandler/node_modules/encodeurl/package.json +40 -0
  174. package/bundled/ollama/node_modules/finalhandler/package.json +9 -10
  175. package/bundled/ollama/node_modules/http-errors/HISTORY.md +0 -6
  176. package/bundled/ollama/node_modules/http-errors/index.js +3 -4
  177. package/bundled/ollama/node_modules/http-errors/package.json +8 -12
  178. package/bundled/ollama/node_modules/qs/CHANGELOG.md +0 -16
  179. package/bundled/ollama/node_modules/qs/README.md +1 -1
  180. package/bundled/ollama/node_modules/qs/dist/qs.js +15 -15
  181. package/bundled/ollama/node_modules/qs/eslint.config.mjs +0 -1
  182. package/bundled/ollama/node_modules/qs/lib/parse.js +24 -54
  183. package/bundled/ollama/node_modules/qs/lib/stringify.js +4 -11
  184. package/bundled/ollama/node_modules/qs/package.json +3 -3
  185. package/bundled/ollama/node_modules/qs/test/parse.js +0 -135
  186. package/bundled/ollama/node_modules/qs/test/stringify.js +0 -138
  187. package/bundled/ollama/node_modules/qs/test/utils.js +3 -31
  188. package/bundled/ollama/node_modules/raw-body/HISTORY.md +308 -0
  189. package/bundled/ollama/node_modules/raw-body/SECURITY.md +24 -0
  190. package/bundled/ollama/node_modules/raw-body/package.json +7 -5
  191. package/bundled/ollama/node_modules/send/HISTORY.md +7 -19
  192. package/bundled/ollama/node_modules/send/node_modules/encodeurl/HISTORY.md +14 -0
  193. package/bundled/ollama/node_modules/send/node_modules/encodeurl/LICENSE +22 -0
  194. package/bundled/ollama/node_modules/send/node_modules/encodeurl/README.md +128 -0
  195. package/bundled/ollama/node_modules/send/node_modules/encodeurl/index.js +60 -0
  196. package/bundled/ollama/node_modules/send/node_modules/encodeurl/package.json +40 -0
  197. package/bundled/ollama/node_modules/send/package.json +6 -6
  198. package/bundled/ollama/node_modules/serve-static/HISTORY.md +0 -16
  199. package/bundled/ollama/node_modules/serve-static/node_modules/encodeurl/HISTORY.md +14 -0
  200. package/bundled/ollama/node_modules/serve-static/node_modules/encodeurl/LICENSE +22 -0
  201. package/bundled/ollama/node_modules/serve-static/node_modules/encodeurl/README.md +128 -0
  202. package/bundled/ollama/node_modules/serve-static/node_modules/encodeurl/index.js +60 -0
  203. package/bundled/ollama/node_modules/serve-static/node_modules/encodeurl/package.json +40 -0
  204. package/bundled/ollama/node_modules/serve-static/package.json +3 -3
  205. package/bundled/ollama/node_modules/statuses/HISTORY.md +0 -5
  206. package/bundled/ollama/node_modules/statuses/README.md +0 -3
  207. package/bundled/ollama/node_modules/statuses/package.json +7 -7
  208. package/bundled/ollama/package-lock.json +107 -88
  209. package/bundled/ollama/package.json +24 -4
  210. package/node_modules/@sap-llm-gateway/service-key-parser/package.json +1 -1
  211. package/package.json +2 -2
  212. package/bundled/gateway/node_modules/axios/lib/helpers/Http2Sessions.js +0 -119
  213. package/bundled/ollama/node_modules/axios/lib/helpers/Http2Sessions.js +0 -119
@@ -0,0 +1,136 @@
1
+ 'use strict';
2
+
3
+ var test = require('tape');
4
+ var inspect = require('object-inspect');
5
+ var SaferBuffer = require('safer-buffer').Buffer;
6
+ var forEach = require('for-each');
7
+ var utils = require('../lib/utils');
8
+
9
+ test('merge()', function (t) {
10
+ t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null');
11
+
12
+ t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array');
13
+
14
+ t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');
15
+
16
+ var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } });
17
+ t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array');
18
+
19
+ var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } });
20
+ t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array');
21
+
22
+ var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' });
23
+ t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array');
24
+
25
+ var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] });
26
+ t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] });
27
+
28
+ var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar');
29
+ t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true });
30
+
31
+ t.test(
32
+ 'avoids invoking array setters unnecessarily',
33
+ { skip: typeof Object.defineProperty !== 'function' },
34
+ function (st) {
35
+ var setCount = 0;
36
+ var getCount = 0;
37
+ var observed = [];
38
+ Object.defineProperty(observed, 0, {
39
+ get: function () {
40
+ getCount += 1;
41
+ return { bar: 'baz' };
42
+ },
43
+ set: function () { setCount += 1; }
44
+ });
45
+ utils.merge(observed, [null]);
46
+ st.equal(setCount, 0);
47
+ st.equal(getCount, 1);
48
+ observed[0] = observed[0]; // eslint-disable-line no-self-assign
49
+ st.equal(setCount, 1);
50
+ st.equal(getCount, 2);
51
+ st.end();
52
+ }
53
+ );
54
+
55
+ t.end();
56
+ });
57
+
58
+ test('assign()', function (t) {
59
+ var target = { a: 1, b: 2 };
60
+ var source = { b: 3, c: 4 };
61
+ var result = utils.assign(target, source);
62
+
63
+ t.equal(result, target, 'returns the target');
64
+ t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged');
65
+ t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched');
66
+
67
+ t.end();
68
+ });
69
+
70
+ test('combine()', function (t) {
71
+ t.test('both arrays', function (st) {
72
+ var a = [1];
73
+ var b = [2];
74
+ var combined = utils.combine(a, b);
75
+
76
+ st.deepEqual(a, [1], 'a is not mutated');
77
+ st.deepEqual(b, [2], 'b is not mutated');
78
+ st.notEqual(a, combined, 'a !== combined');
79
+ st.notEqual(b, combined, 'b !== combined');
80
+ st.deepEqual(combined, [1, 2], 'combined is a + b');
81
+
82
+ st.end();
83
+ });
84
+
85
+ t.test('one array, one non-array', function (st) {
86
+ var aN = 1;
87
+ var a = [aN];
88
+ var bN = 2;
89
+ var b = [bN];
90
+
91
+ var combinedAnB = utils.combine(aN, b);
92
+ st.deepEqual(b, [bN], 'b is not mutated');
93
+ st.notEqual(aN, combinedAnB, 'aN + b !== aN');
94
+ st.notEqual(a, combinedAnB, 'aN + b !== a');
95
+ st.notEqual(bN, combinedAnB, 'aN + b !== bN');
96
+ st.notEqual(b, combinedAnB, 'aN + b !== b');
97
+ st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array');
98
+
99
+ var combinedABn = utils.combine(a, bN);
100
+ st.deepEqual(a, [aN], 'a is not mutated');
101
+ st.notEqual(aN, combinedABn, 'a + bN !== aN');
102
+ st.notEqual(a, combinedABn, 'a + bN !== a');
103
+ st.notEqual(bN, combinedABn, 'a + bN !== bN');
104
+ st.notEqual(b, combinedABn, 'a + bN !== b');
105
+ st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array');
106
+
107
+ st.end();
108
+ });
109
+
110
+ t.test('neither is an array', function (st) {
111
+ var combined = utils.combine(1, 2);
112
+ st.notEqual(1, combined, '1 + 2 !== 1');
113
+ st.notEqual(2, combined, '1 + 2 !== 2');
114
+ st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array');
115
+
116
+ st.end();
117
+ });
118
+
119
+ t.end();
120
+ });
121
+
122
+ test('isBuffer()', function (t) {
123
+ forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) {
124
+ t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer');
125
+ });
126
+
127
+ var fakeBuffer = { constructor: Buffer };
128
+ t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer');
129
+
130
+ var saferBuffer = SaferBuffer.from('abc');
131
+ t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer');
132
+
133
+ var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc');
134
+ t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer');
135
+ t.end();
136
+ });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "express",
3
3
  "description": "Fast, unopinionated, minimalist web framework",
4
- "version": "4.22.2",
4
+ "version": "4.20.0",
5
5
  "author": "TJ Holowaychuk <tj@vision-media.ca>",
6
6
  "contributors": [
7
7
  "Aaron Heckmann <aaron.heckmann+github@gmail.com>",
@@ -15,10 +15,6 @@
15
15
  "license": "MIT",
16
16
  "repository": "expressjs/express",
17
17
  "homepage": "http://expressjs.com/",
18
- "funding": {
19
- "type": "opencollective",
20
- "url": "https://opencollective.com/express"
21
- },
22
18
  "keywords": [
23
19
  "express",
24
20
  "framework",
@@ -34,32 +30,32 @@
34
30
  "dependencies": {
35
31
  "accepts": "~1.3.8",
36
32
  "array-flatten": "1.1.1",
37
- "body-parser": "~1.20.5",
38
- "content-disposition": "~0.5.4",
33
+ "body-parser": "1.20.3",
34
+ "content-disposition": "0.5.4",
39
35
  "content-type": "~1.0.4",
40
- "cookie": "~0.7.1",
41
- "cookie-signature": "~1.0.6",
36
+ "cookie": "0.6.0",
37
+ "cookie-signature": "1.0.6",
42
38
  "debug": "2.6.9",
43
39
  "depd": "2.0.0",
44
40
  "encodeurl": "~2.0.0",
45
41
  "escape-html": "~1.0.3",
46
42
  "etag": "~1.8.1",
47
- "finalhandler": "~1.3.1",
48
- "fresh": "~0.5.2",
49
- "http-errors": "~2.0.0",
43
+ "finalhandler": "1.2.0",
44
+ "fresh": "0.5.2",
45
+ "http-errors": "2.0.0",
50
46
  "merge-descriptors": "1.0.3",
51
47
  "methods": "~1.1.2",
52
- "on-finished": "~2.4.1",
48
+ "on-finished": "2.4.1",
53
49
  "parseurl": "~1.3.3",
54
- "path-to-regexp": "~0.1.12",
50
+ "path-to-regexp": "0.1.10",
55
51
  "proxy-addr": "~2.0.7",
56
- "qs": "~6.15.1",
52
+ "qs": "6.11.0",
57
53
  "range-parser": "~1.2.1",
58
54
  "safe-buffer": "5.2.1",
59
- "send": "~0.19.0",
60
- "serve-static": "~1.16.2",
55
+ "send": "0.19.0",
56
+ "serve-static": "1.16.0",
61
57
  "setprototypeof": "1.2.0",
62
- "statuses": "~2.0.1",
58
+ "statuses": "2.0.1",
63
59
  "type-is": "~1.6.18",
64
60
  "utils-merge": "1.0.1",
65
61
  "vary": "~1.1.2"
@@ -75,11 +71,11 @@
75
71
  "hbs": "4.2.0",
76
72
  "marked": "0.7.0",
77
73
  "method-override": "3.0.0",
78
- "mocha": "^6.2.2",
74
+ "mocha": "10.2.0",
79
75
  "morgan": "1.10.0",
80
- "nyc": "^14.1.1",
76
+ "nyc": "15.1.0",
81
77
  "pbkdf2-password": "1.2.1",
82
- "supertest": "^6.1.6",
78
+ "supertest": "6.3.0",
83
79
  "vhost": "~3.0.2"
84
80
  },
85
81
  "engines": {
@@ -1,24 +1,3 @@
1
- v1.3.2 / 2025-12-01
2
- ==================
3
-
4
- * deps: use tilde notation for dependencies
5
- * deps: statuses@~2.0.2
6
-
7
- v1.3.1 / 2024-09-11
8
- ==================
9
-
10
- * deps: encodeurl@~2.0.0
11
-
12
- v1.3.0 / 2024-09-03
13
- ==================
14
-
15
- * ignore status message for HTTP/2 (#53)
16
-
17
- v1.2.1 / 2024-09-02
18
- ==================
19
-
20
- * Gracefully handle when handling an error and socket is null
21
-
22
1
  1.2.0 / 2022-03-22
23
2
  ==================
24
3
 
@@ -143,5 +143,5 @@ function logerror (err) {
143
143
  [coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master
144
144
  [downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg
145
145
  [downloads-url]: https://npmjs.org/package/finalhandler
146
- [github-actions-ci-image]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml/badge.svg
147
- [github-actions-ci-url]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml
146
+ [github-actions-ci-image]: https://img.shields.io/github/workflow/status/pillarjs/finalhandler/ci/master?label=ci
147
+ [github-actions-ci-url]: https://github.com/jshttp/pillarjs/finalhandler?query=workflow%3Aci
@@ -125,9 +125,7 @@ function finalhandler (req, res, options) {
125
125
  // cannot actually respond
126
126
  if (headersSent(res)) {
127
127
  debug('cannot %d after headers sent', status)
128
- if (req.socket) {
129
- req.socket.destroy()
130
- }
128
+ req.socket.destroy()
131
129
  return
132
130
  }
133
131
 
@@ -278,10 +276,7 @@ function send (req, res, status, headers, message) {
278
276
 
279
277
  // response status
280
278
  res.statusCode = status
281
-
282
- if (req.httpVersionMajor < 2) {
283
- res.statusMessage = statuses.message[status]
284
- }
279
+ res.statusMessage = statuses.message[status]
285
280
 
286
281
  // remove any content headers
287
282
  res.removeHeader('Content-Encoding')
@@ -0,0 +1,14 @@
1
+ 1.0.2 / 2018-01-21
2
+ ==================
3
+
4
+ * Fix encoding `%` as last character
5
+
6
+ 1.0.1 / 2016-06-09
7
+ ==================
8
+
9
+ * Fix encoding unpaired surrogates at start/end of string
10
+
11
+ 1.0.0 / 2016-06-08
12
+ ==================
13
+
14
+ * Initial release
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2016 Douglas Christopher Wilson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,128 @@
1
+ # encodeurl
2
+
3
+ [![NPM Version][npm-image]][npm-url]
4
+ [![NPM Downloads][downloads-image]][downloads-url]
5
+ [![Node.js Version][node-version-image]][node-version-url]
6
+ [![Build Status][travis-image]][travis-url]
7
+ [![Test Coverage][coveralls-image]][coveralls-url]
8
+
9
+ Encode a URL to a percent-encoded form, excluding already-encoded sequences
10
+
11
+ ## Installation
12
+
13
+ This is a [Node.js](https://nodejs.org/en/) module available through the
14
+ [npm registry](https://www.npmjs.com/). Installation is done using the
15
+ [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
16
+
17
+ ```sh
18
+ $ npm install encodeurl
19
+ ```
20
+
21
+ ## API
22
+
23
+ ```js
24
+ var encodeUrl = require('encodeurl')
25
+ ```
26
+
27
+ ### encodeUrl(url)
28
+
29
+ Encode a URL to a percent-encoded form, excluding already-encoded sequences.
30
+
31
+ This function will take an already-encoded URL and encode all the non-URL
32
+ code points (as UTF-8 byte sequences). This function will not encode the
33
+ "%" character unless it is not part of a valid sequence (`%20` will be
34
+ left as-is, but `%foo` will be encoded as `%25foo`).
35
+
36
+ This encode is meant to be "safe" and does not throw errors. It will try as
37
+ hard as it can to properly encode the given URL, including replacing any raw,
38
+ unpaired surrogate pairs with the Unicode replacement character prior to
39
+ encoding.
40
+
41
+ This function is _similar_ to the intrinsic function `encodeURI`, except it
42
+ will not encode the `%` character if that is part of a valid sequence, will
43
+ not encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired
44
+ surrogate pairs with the Unicode replacement character (instead of throwing).
45
+
46
+ ## Examples
47
+
48
+ ### Encode a URL containing user-controled data
49
+
50
+ ```js
51
+ var encodeUrl = require('encodeurl')
52
+ var escapeHtml = require('escape-html')
53
+
54
+ http.createServer(function onRequest (req, res) {
55
+ // get encoded form of inbound url
56
+ var url = encodeUrl(req.url)
57
+
58
+ // create html message
59
+ var body = '<p>Location ' + escapeHtml(url) + ' not found</p>'
60
+
61
+ // send a 404
62
+ res.statusCode = 404
63
+ res.setHeader('Content-Type', 'text/html; charset=UTF-8')
64
+ res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8')))
65
+ res.end(body, 'utf-8')
66
+ })
67
+ ```
68
+
69
+ ### Encode a URL for use in a header field
70
+
71
+ ```js
72
+ var encodeUrl = require('encodeurl')
73
+ var escapeHtml = require('escape-html')
74
+ var url = require('url')
75
+
76
+ http.createServer(function onRequest (req, res) {
77
+ // parse inbound url
78
+ var href = url.parse(req)
79
+
80
+ // set new host for redirect
81
+ href.host = 'localhost'
82
+ href.protocol = 'https:'
83
+ href.slashes = true
84
+
85
+ // create location header
86
+ var location = encodeUrl(url.format(href))
87
+
88
+ // create html message
89
+ var body = '<p>Redirecting to new site: ' + escapeHtml(location) + '</p>'
90
+
91
+ // send a 301
92
+ res.statusCode = 301
93
+ res.setHeader('Content-Type', 'text/html; charset=UTF-8')
94
+ res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8')))
95
+ res.setHeader('Location', location)
96
+ res.end(body, 'utf-8')
97
+ })
98
+ ```
99
+
100
+ ## Testing
101
+
102
+ ```sh
103
+ $ npm test
104
+ $ npm run lint
105
+ ```
106
+
107
+ ## References
108
+
109
+ - [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986]
110
+ - [WHATWG URL Living Standard][whatwg-url]
111
+
112
+ [rfc-3986]: https://tools.ietf.org/html/rfc3986
113
+ [whatwg-url]: https://url.spec.whatwg.org/
114
+
115
+ ## License
116
+
117
+ [MIT](LICENSE)
118
+
119
+ [npm-image]: https://img.shields.io/npm/v/encodeurl.svg
120
+ [npm-url]: https://npmjs.org/package/encodeurl
121
+ [node-version-image]: https://img.shields.io/node/v/encodeurl.svg
122
+ [node-version-url]: https://nodejs.org/en/download
123
+ [travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg
124
+ [travis-url]: https://travis-ci.org/pillarjs/encodeurl
125
+ [coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg
126
+ [coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master
127
+ [downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg
128
+ [downloads-url]: https://npmjs.org/package/encodeurl
@@ -0,0 +1,60 @@
1
+ /*!
2
+ * encodeurl
3
+ * Copyright(c) 2016 Douglas Christopher Wilson
4
+ * MIT Licensed
5
+ */
6
+
7
+ 'use strict'
8
+
9
+ /**
10
+ * Module exports.
11
+ * @public
12
+ */
13
+
14
+ module.exports = encodeUrl
15
+
16
+ /**
17
+ * RegExp to match non-URL code points, *after* encoding (i.e. not including "%")
18
+ * and including invalid escape sequences.
19
+ * @private
20
+ */
21
+
22
+ var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g
23
+
24
+ /**
25
+ * RegExp to match unmatched surrogate pair.
26
+ * @private
27
+ */
28
+
29
+ var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g
30
+
31
+ /**
32
+ * String to replace unmatched surrogate pair with.
33
+ * @private
34
+ */
35
+
36
+ var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2'
37
+
38
+ /**
39
+ * Encode a URL to a percent-encoded form, excluding already-encoded sequences.
40
+ *
41
+ * This function will take an already-encoded URL and encode all the non-URL
42
+ * code points. This function will not encode the "%" character unless it is
43
+ * not part of a valid sequence (`%20` will be left as-is, but `%foo` will
44
+ * be encoded as `%25foo`).
45
+ *
46
+ * This encode is meant to be "safe" and does not throw errors. It will try as
47
+ * hard as it can to properly encode the given URL, including replacing any raw,
48
+ * unpaired surrogate pairs with the Unicode replacement character prior to
49
+ * encoding.
50
+ *
51
+ * @param {string} url
52
+ * @return {string}
53
+ * @public
54
+ */
55
+
56
+ function encodeUrl (url) {
57
+ return String(url)
58
+ .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE)
59
+ .replace(ENCODE_CHARS_REGEXP, encodeURI)
60
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "encodeurl",
3
+ "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences",
4
+ "version": "1.0.2",
5
+ "contributors": [
6
+ "Douglas Christopher Wilson <doug@somethingdoug.com>"
7
+ ],
8
+ "license": "MIT",
9
+ "keywords": [
10
+ "encode",
11
+ "encodeurl",
12
+ "url"
13
+ ],
14
+ "repository": "pillarjs/encodeurl",
15
+ "devDependencies": {
16
+ "eslint": "3.19.0",
17
+ "eslint-config-standard": "10.2.1",
18
+ "eslint-plugin-import": "2.8.0",
19
+ "eslint-plugin-node": "5.2.1",
20
+ "eslint-plugin-promise": "3.6.0",
21
+ "eslint-plugin-standard": "3.0.1",
22
+ "istanbul": "0.4.5",
23
+ "mocha": "2.5.3"
24
+ },
25
+ "files": [
26
+ "LICENSE",
27
+ "HISTORY.md",
28
+ "README.md",
29
+ "index.js"
30
+ ],
31
+ "engines": {
32
+ "node": ">= 0.8"
33
+ },
34
+ "scripts": {
35
+ "lint": "eslint .",
36
+ "test": "mocha --reporter spec --bail --check-leaks test/",
37
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
38
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
39
+ }
40
+ }
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "finalhandler",
3
3
  "description": "Node.js final http responder",
4
- "version": "1.3.2",
4
+ "version": "1.2.0",
5
5
  "author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
6
6
  "license": "MIT",
7
7
  "repository": "pillarjs/finalhandler",
8
8
  "dependencies": {
9
9
  "debug": "2.6.9",
10
- "encodeurl": "~2.0.0",
10
+ "encodeurl": "~1.0.2",
11
11
  "escape-html": "~1.0.3",
12
- "on-finished": "~2.4.1",
12
+ "on-finished": "2.4.1",
13
13
  "parseurl": "~1.3.3",
14
- "statuses": "~2.0.2",
14
+ "statuses": "2.0.1",
15
15
  "unpipe": "~1.0.0"
16
16
  },
17
17
  "devDependencies": {
18
18
  "eslint": "7.32.0",
19
19
  "eslint-config-standard": "14.1.1",
20
- "eslint-plugin-import": "2.26.0",
20
+ "eslint-plugin-import": "2.25.4",
21
21
  "eslint-plugin-markdown": "2.2.1",
22
22
  "eslint-plugin-node": "11.1.0",
23
23
  "eslint-plugin-promise": "5.2.0",
24
24
  "eslint-plugin-standard": "4.1.0",
25
- "mocha": "10.0.0",
25
+ "mocha": "9.2.2",
26
26
  "nyc": "15.1.0",
27
27
  "readable-stream": "2.3.6",
28
28
  "safe-buffer": "5.2.1",
29
- "supertest": "6.2.4"
29
+ "supertest": "6.2.2"
30
30
  },
31
31
  "files": [
32
32
  "LICENSE",
@@ -39,9 +39,8 @@
39
39
  },
40
40
  "scripts": {
41
41
  "lint": "eslint .",
42
- "test": "mocha --reporter spec --check-leaks test/",
42
+ "test": "mocha --reporter spec --bail --check-leaks test/",
43
43
  "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
44
- "test-cov": "nyc --reporter=html --reporter=text npm test",
45
- "test-inspect": "mocha --reporter spec --inspect --inspect-brk test/"
44
+ "test-cov": "nyc --reporter=html --reporter=text npm test"
46
45
  }
47
46
  }
@@ -1,9 +1,3 @@
1
- 2.0.1 / 2025-11-20
2
- ==================
3
-
4
- * deps: use tilde notation for dependencies
5
- * deps: update statuses to 2.0.2
6
-
7
1
  2.0.0 / 2021-12-17
8
2
  ==================
9
3
 
@@ -279,12 +279,11 @@ function populateConstructorExports (exports, codes, HttpError) {
279
279
 
280
280
  /**
281
281
  * Get a class name from a name identifier.
282
- *
283
- * @param {string} name
284
- * @returns {string}
285
282
  * @private
286
283
  */
287
284
 
288
285
  function toClassName (name) {
289
- return name.slice(-5) === 'Error' ? name : name + 'Error'
286
+ return name.substr(-5) !== 'Error'
287
+ ? name + 'Error'
288
+ : name
290
289
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "http-errors",
3
3
  "description": "Create HTTP error objects",
4
- "version": "2.0.1",
4
+ "version": "2.0.0",
5
5
  "author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
6
6
  "contributors": [
7
7
  "Alan Plum <me@pluma.io>",
@@ -9,21 +9,17 @@
9
9
  ],
10
10
  "license": "MIT",
11
11
  "repository": "jshttp/http-errors",
12
- "funding": {
13
- "type": "opencollective",
14
- "url": "https://opencollective.com/express"
15
- },
16
12
  "dependencies": {
17
- "depd": "~2.0.0",
18
- "inherits": "~2.0.4",
19
- "setprototypeof": "~1.2.0",
20
- "statuses": "~2.0.2",
21
- "toidentifier": "~1.0.1"
13
+ "depd": "2.0.0",
14
+ "inherits": "2.0.4",
15
+ "setprototypeof": "1.2.0",
16
+ "statuses": "2.0.1",
17
+ "toidentifier": "1.0.1"
22
18
  },
23
19
  "devDependencies": {
24
20
  "eslint": "7.32.0",
25
21
  "eslint-config-standard": "14.1.1",
26
- "eslint-plugin-import": "2.32.0",
22
+ "eslint-plugin-import": "2.25.3",
27
23
  "eslint-plugin-markdown": "2.2.1",
28
24
  "eslint-plugin-node": "11.1.0",
29
25
  "eslint-plugin-promise": "5.2.0",
@@ -36,7 +32,7 @@
36
32
  },
37
33
  "scripts": {
38
34
  "lint": "eslint . && node ./scripts/lint-readme-list.js",
39
- "test": "mocha --reporter spec",
35
+ "test": "mocha --reporter spec --bail",
40
36
  "test-ci": "nyc --reporter=lcov --reporter=text npm test",
41
37
  "test-cov": "nyc --reporter=html --reporter=text npm test",
42
38
  "version": "node scripts/version-history.js && git add HISTORY.md"