@techiev2/vajra 1.3.0 → 1.3.1
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/index.js +1 -0
- package/package.json +1 -1
- package/video.mp4 +0 -0
package/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export default class Vajra {
|
|
|
31
31
|
process.on('exit', logOut); function log(message) { _queue.push(`${message}\n`); if (_queue.length >= LOG_QUEUE_SIZE) { logOut(); _queue.length = 0; } }
|
|
32
32
|
Vajra.#MAX_FILE_SIZE = !+MAX_FILE_SIZE ? +maxFileSize * 1024 * 1024 : MAX_FILE_SIZE
|
|
33
33
|
Vajra.#app.on('request', async (req, res) => {
|
|
34
|
+
if (+(req.headers['Content-Length'] || req.headers['content-length']) > Vajra.#MAX_FILE_SIZE) { return default_413(res) }
|
|
34
35
|
res.sent = false;
|
|
35
36
|
res.status = (/**@type{code} Number*/ code) => {
|
|
36
37
|
if (!+code || +code < 100 || +code > 599) { throw new Error(`Invalid status code ${code}`) }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techiev2/vajra",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Blazing-fast, zero-dependency Node.js server with routing, middleware, multipart uploads, and templating. 111 lines · ~95k req/s · ~52 MB idle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"http-server",
|
package/video.mp4
ADDED
|
Binary file
|