@spirobel/mininext 0.2.19 → 0.2.21
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/dist/html.d.ts +1 -1
- package/dist/html.js +1 -1
- package/dist/url.js +8 -1
- package/mininext/html.ts +1 -1
- package/mininext/url.ts +7 -1
- package/package.json +1 -1
package/dist/html.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const cssReset: HtmlString;
|
|
|
28
28
|
*
|
|
29
29
|
* @example Here is what a default head might look like:
|
|
30
30
|
* ```ts
|
|
31
|
-
*head(html` <title>hello hello</title> `);
|
|
31
|
+
*head((mini)=>mini.html` <title>hello hello</title> `);
|
|
32
32
|
* url.set([
|
|
33
33
|
* ["/", (mini) => mini.html`<h1>Hello world</h1>`],
|
|
34
34
|
* [
|
package/dist/html.js
CHANGED
|
@@ -169,7 +169,7 @@ let default_head = (mini) => mini.html `
|
|
|
169
169
|
*
|
|
170
170
|
* @example Here is what a default head might look like:
|
|
171
171
|
* ```ts
|
|
172
|
-
*head(html` <title>hello hello</title> `);
|
|
172
|
+
*head((mini)=>mini.html` <title>hello hello</title> `);
|
|
173
173
|
* url.set([
|
|
174
174
|
* ["/", (mini) => mini.html`<h1>Hello world</h1>`],
|
|
175
175
|
* [
|
package/dist/url.js
CHANGED
|
@@ -327,7 +327,14 @@ export class url {
|
|
|
327
327
|
const urlencoded = (req.headers.get("Content-Type") + "").includes("application/x-www-form-urlencoded");
|
|
328
328
|
const multipart = (req.headers.get("Content-Type") + "").includes("multipart/form-data");
|
|
329
329
|
if (post && !urlencoded && !multipart) {
|
|
330
|
-
|
|
330
|
+
const length = Number(req.headers.get("content-length"));
|
|
331
|
+
const bodyNotEmpty = length > 0;
|
|
332
|
+
if (bodyNotEmpty) {
|
|
333
|
+
formJson = await req.json();
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
formJson = {};
|
|
337
|
+
}
|
|
331
338
|
}
|
|
332
339
|
if (post && (urlencoded || multipart)) {
|
|
333
340
|
formData = await req.formData();
|
package/mininext/html.ts
CHANGED
|
@@ -204,7 +204,7 @@ let default_head: HtmlHandler = (mini: Mini) => mini.html`
|
|
|
204
204
|
*
|
|
205
205
|
* @example Here is what a default head might look like:
|
|
206
206
|
* ```ts
|
|
207
|
-
*head(html` <title>hello hello</title> `);
|
|
207
|
+
*head((mini)=>mini.html` <title>hello hello</title> `);
|
|
208
208
|
* url.set([
|
|
209
209
|
* ["/", (mini) => mini.html`<h1>Hello world</h1>`],
|
|
210
210
|
* [
|
package/mininext/url.ts
CHANGED
|
@@ -425,7 +425,13 @@ export class url {
|
|
|
425
425
|
"multipart/form-data"
|
|
426
426
|
);
|
|
427
427
|
if (post && !urlencoded && !multipart) {
|
|
428
|
-
|
|
428
|
+
const length = Number(req.headers.get("content-length"));
|
|
429
|
+
const bodyNotEmpty = length > 0;
|
|
430
|
+
if (bodyNotEmpty) {
|
|
431
|
+
formJson = await req.json();
|
|
432
|
+
} else {
|
|
433
|
+
formJson = {};
|
|
434
|
+
}
|
|
429
435
|
}
|
|
430
436
|
if (post && (urlencoded || multipart)) {
|
|
431
437
|
formData = await req.formData();
|