Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ecstatic with tests #693

Merged
merged 17 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
npm-debug.log*
.nyc_*/
.dir-locals.el
.DS_Store
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
sudo: false
language: node_js
node_js:
- "6"
- "8"
- "10"
- "12"
Expand Down
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2011-2020 Charlie Robbins, Marak Squires, and the Contributors.
Copyright (c) 2011-2021 Charlie Robbins, Marak Squires, Jade Michael Thornton
and the Contributors.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
35 changes: 35 additions & 0 deletions lib/core/aliases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"autoIndex": [ "autoIndex", "autoindex" ],
"showDir": [ "showDir", "showdir" ],
"showDotfiles": ["showDotfiles", "showdotfiles"],
"humanReadable": [ "humanReadable", "humanreadable", "human-readable" ],
"hidePermissions": ["hidePermissions", "hidepermissions", "hide-permissions"],
"si": [ "si", "index" ],
"handleError": [ "handleError", "handleerror" ],
"cors": [ "cors", "CORS" ],
"headers": [ "H", "header", "headers" ],
"serverHeader": [ "serverHeader", "serverheader", "server-header" ],
"contentType": [ "contentType", "contenttype", "content-type" ],
"mimeType": [
"mimetype",
"mimetypes",
"mimeType",
"mimeTypes",
"mime-type",
"mime-types",
"mime-Type",
"mime-Types"
],
"weakEtags": [ "weakEtags", "weaketags", "weak-etags" ],
"weakCompare": [
"weakcompare",
"weakCompare",
"weak-compare",
"weak-Compare"
],
"handleOptionsMethod": [
"handleOptionsMethod",
"handleoptionsmethod",
"handle-options-method"
]
}
19 changes: 19 additions & 0 deletions lib/core/defaults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"autoIndex": true,
"showDir": true,
"showDotfiles": true,
"humanReadable": true,
"hidePermissions": false,
"si": false,
"cache": "max-age=3600",
"cors": false,
"gzip": true,
"brotli": false,
"defaultExt": ".html",
"handleError": true,
"serverHeader": true,
"contentType": "application/octet-stream",
"weakEtags": true,
"weakCompare": true,
"handleOptionsMethod": false
}
9 changes: 9 additions & 0 deletions lib/core/etag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

module.exports = (stat, weakEtag) => {
let etag = `"${[stat.ino, stat.size, stat.mtime.toISOString()].join('-')}"`;
if (weakEtag) {
etag = `W/${etag}`;
}
return etag;
};
Loading