Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
03be38d
- Optimization: 'use strict' directive (and avoid octal)
brettz9 Mar 28, 2021
e18ca01
- Time display logging with leading 0
brettz9 Mar 28, 2021
036c6f7
- npm: Add scoping: @brettz9/node-static
brettz9 Mar 28, 2021
1e7db15
- Docs: Fix header example
brettz9 Mar 28, 2021
c1eb9d6
Support bytes=0-0 range header
brettz9 Mar 29, 2021
e19686f
For spa, allow dots after path
brettz9 Mar 29, 2021
48691d2
- Enhancement: Allow `serverInfo` to be `null`; add test for null and…
brettz9 Mar 29, 2021
83aac2e
- Prefer includes or startsWith over indexOf where possible
brettz9 Mar 29, 2021
5fb988f
Protect fs.stats from bad path arguments (#223)
brpvieira Mar 29, 2021
e005d72
- Docs: CHANGES.md
brettz9 Mar 29, 2021
67a2882
Respect static --cache 0 (#138)
matthew-andrews Mar 29, 2021
fdb4bde
- Docs: Fix typo
brettz9 Mar 29, 2021
ec5ae0e
- git: Ignore `.idea`
brettz9 Mar 29, 2021
fead875
Support access with local IP (#140)
flyingsky Mar 29, 2021
c33b3c8
- Add another fs.stat guard
brettz9 Mar 29, 2021
d762b52
Add new option: defaultExtension (#173)
fmalk Mar 29, 2021
3800c7b
- npm: Update lock file
brettz9 Mar 29, 2021
467da7e
- Optimization: Remove unused `colors`
brettz9 Mar 29, 2021
45ba0fb
- npm: Update `mime` (updating to latest minor update only)
brettz9 Mar 29, 2021
9343210
Fix vulnerabilities found with npm audit (#222)
fidian Mar 29, 2021
e7f1a20
- Refactoring: Use safer non-prototype version of `colors` (had indee…
brettz9 Mar 29, 2021
4adf088
- Fix bugs/homepage URL
brettz9 Mar 29, 2021
b0acead
- Docs: Add missing credit to CHANGES
brettz9 Mar 29, 2021
ebc58cf
- Docs: Code
brettz9 Mar 29, 2021
c482b25
- Testing: Add checks for supposed direct node-static unauthorized fi…
brettz9 Mar 29, 2021
55012ad
- Use non-deprecated URL constructor for parsing; also appears it may…
brettz9 Mar 29, 2021
2bd53c7
Support glob matching for cache headers (#183)
lightswitch05 Mar 29, 2021
03cbdee
- Testing: Add `example.com` file to confirm https://www.npmjs.com/ad…
brettz9 Mar 29, 2021
8c8590a
- Add DOCTYPE in fixtures (for suppressing IDE validation)
brettz9 Mar 29, 2021
a75948f
- Docs: Give credit in CHANGES
brettz9 Mar 29, 2021
2bf6598
- Docs: Set off code
brettz9 Mar 29, 2021
45c3bcc
- npm: Update `minimatch`
brettz9 Mar 29, 2021
3a49617
- Remove ncurc file (already updated)
brettz9 Mar 29, 2021
33e9f2c
- License: Add own name
brettz9 Mar 29, 2021
901b561
- Update/fix: Protect additional `fs.stat` call (for `defaultExtension`)
brettz9 Mar 29, 2021
9ee5a98
- Docs: Detail some changes from fork
brettz9 Mar 30, 2021
54eb868
- Docs: CHANGES clarifications
brettz9 Mar 30, 2021
95670d7
- Docs (CHANGES): Denote security fix
brettz9 Mar 30, 2021
4d73a6c
- Docs (CHANGES): Further security fix denotations
brettz9 Mar 30, 2021
577b907
- Docs (CHANGES): Fix labeling of issue and indicate security fixes a…
brettz9 Mar 30, 2021
bdf9013
- Testing: Add `nyc` for coverage
brettz9 Mar 30, 2021
d12cfb9
- Docs (CHANGES): Fix
brettz9 Mar 30, 2021
c6d7106
Revert scoping changes; line breaks; use of `const` in README
brettz9 May 21, 2021
4c8c699
docs: add installation info; add consistent heading styles closes #226
brettz9 May 21, 2021
53f292d
docs: Remove now redundant install section, make defaults visible in …
brettz9 May 21, 2021
4f7e8cc
Ignore: revert resetting of version (for old fork) to last version on…
brettz9 May 21, 2021
0e904ea
fix: ensure package version stays up to date; fixes #214
brettz9 May 21, 2021
b761da3
chore: update devDep. (eslint)
brettz9 May 21, 2021
2163bbf
chore: bump `engines` to maintained Node (12+)
brettz9 May 30, 2021
87613b2
refactor: switch to ES6 class
brettz9 May 30, 2021
2aadad7
refactor: consistent use of quotes (single)
brettz9 May 30, 2021
14a771a
refactor: list 3rd party deps. together
brettz9 May 30, 2021
36eb933
fix: path should be more generous in unescaping anything valid in a p…
brettz9 May 30, 2021
e7cb791
chore: update devDep. (eslint) and apply `npm audit fix` on lock file…
brettz9 Jul 15, 2021
5c73439
docs(CHANGES): update
brettz9 Jul 15, 2021
7127d43
Add ESM support (#229)
brettz9 Jul 24, 2021
c3f5d4e
feat: switch to lighter command-line-basics (#230)
brettz9 Jul 24, 2021
ee23ca0
refactor: remove redundant line
brettz9 Jul 24, 2021
be6318b
test: add utility for retrieval checks and begin tests
brettz9 Jul 25, 2021
e256a73
test: indicate how to get stdout
brettz9 Jul 25, 2021
9ff85fa
testing: run tests in parallel
brettz9 Jul 25, 2021
6121bd1
testing: add CI workflow
brettz9 Jul 25, 2021
acc7da0
test: update `actions/setup-node` version
brettz9 Jul 25, 2021
03fa0d3
fix: allow `cache` to parse a JSON object-based argument
brettz9 Jul 31, 2021
6efac07
test: for binary, check file without directory and with custom cache
brettz9 Jul 31, 2021
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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; EditorConfig file: https://EditorConfig.org
; Install the "EditorConfig" plugin into your editor to use

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.json]
indent_size = 2
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
27 changes: 27 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

module.exports = {
env: {
es6: true,
node: true
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021
},
extends: ['eslint:recommended'],
overrides: [
{
files: 'test/**',
env: {
mocha: true
}
}
],
rules: {
indent: ['error', 4],
'no-var': ['error'],
'no-unused-vars': ['error', {args: 'none'}],
'prefer-const': ['error']
}
};
26 changes: 26 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node.js CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 12.x
- 14.x
- 16.x
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
npm-debug.log
node_modules
coverage

.idea
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test
benchmark
coverage
.nyc_output
rollup.config.js
57 changes: 57 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# CHANGES for `node-static`

## ? (UNRELEASED)

### User-facing

- **Breaking change** (npm): Set `engines` to 12.0.0+
- **Breaking change**: Add `type: 'module'` and `exports` to `package.json`;
change internal CJS path
- Security: Fix dependency vulnerabilities by switching from `optimist` to
`neodoc` (@fidian)
- Security: Update `mime` and `colors` (@fidian)
- Security Update/fix: Use `URL` constructor over deprecated `url.parse`;
should fix Open Redirect issue <https://www.npmjs.com/advisories/1207>
- Security Update/fix: Protect `fs.stat` calls from bad path arguments; fixes
Denial of Service issue <https://www.npmjs.com/advisories/1208>
(@brpvieira)
- Security fix?: The Unauthorized File Access issue
<https://www.npmjs.com/advisories/1206> does not appear to be an issue
per testing (if it ever was); if you can provide a test case where it
fails, please report
- Fix: Support `bytes=0-0` Range header (@prajwalkman)
- Fix: Avoid octal (@bgao / @Ilrilan)
- Fix: For `spa`, allow dots after path (@gjuchault)
- Fix: Ensure package `version` stays up to date
- Fix: path should be more generous in unescaping anything valid in a
path (such as a hash)
- Enhancement: Allow access with local ip (@flyingsky)
- Enhancement: Allow `serverInfo` to be `null` (@martindale)
- Enhancement: Time display logging with leading 0 (@mauris)
- Enhancement: Respect static `--cache 0` (@matthew-andrews)
- Enhancement: New option: `defaultExtension` (@fmalk)
- Enhancement: Added glob matching for setting cache headers (@lightswitch05)
- Update: Switch from deprecated `request` to `node-fetch`
- Optimization: 'use strict' directive
- Refactoring: Switch to ESM
- Docs: For examples (and internally) avoid `static` reserved word
- Docs: Fix header example (@emmanouil)
- Docs: Sp. (@EdwardBetts)
- Docs: Make install section more visible, make defaults visible in
semantically marked-up headings and add CLI options
- Docs: Add `CHANGES.md`
- Docs: Add ESM file-server example

### Dev-facing

- Linting: Prefer const, no-var, fix indent, comment-out unused,
prefer `startsWith` and `includes`
- Refactoring: Use safer non-prototype version of `colors`
- Maintenance: Add `.editorconfig`
- Testing: Add checks for supposed direct `node-static` vulnerabilities
- Testing: Add test for `null` and non-`null` serverInfo
- Testing: Allow tests to end (@fmalk)
- Testing: Switch to `mocha`/`chai`/`c8`
- Testing: Begin binary file coverage
- npm: Add eslint devDep. and script
- npm: Add lock file
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2010-14 Alexis Sellier
Copyright (c) 2021 Brett Zamir

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
Loading