Skip to content

up#9

Merged
rafiibrahim8 merged 15 commits intorafiibrahim8:masterfrom
http-party:master
Oct 25, 2025
Merged

up#9
rafiibrahim8 merged 15 commits intorafiibrahim8:masterfrom
http-party:master

Conversation

@rafiibrahim8
Copy link
Copy Markdown
Owner

Relevant issues
Contributor checklist
  • Provide tests for the changes (unless documentation-only)
  • Documented any new features, CLI switches, etc. (if applicable)
    • Server --help output
    • README.md
    • doc/http-server.1 (use the same format as other entries)
  • The pull request is being made against the master branch
Maintainer checklist
  • Assign a version triage tag
  • Approve tests if applicable

operagxoksana and others added 15 commits March 1, 2025 15:51
The `--cors` flag documentation incorrectly stated it controls the value
of `Access-Control-Allow-Origin`, when in reality it always sets it to '*'.
The optional parameter value actually adds to `Access-Control-Allow-Headers`,
not `Access-Control-Allow-Origin`.

This commit corrects the documentation to accurately describe the behavior:
- `--cors` enables CORS by setting `Access-Control-Allow-Origin` to '*'
- `--cors='header1,header2'` adds custom headers to `Access-Control-Allow-Headers`
Fix CORS option documentation to match actual behavior
Support both string ('IPv4') and numeric (4) family values from
os.networkInterfaces() to handle the API change in Node.js 18+.

Fixes #810
Verify that interface filtering handles both string and numeric
family values from `os.networkInterfaces()` across Node versions.

Related to #810
Adds a media query for `prefers-color-scheme` to make directory listings more consistent with the color scheme of the environment.
* feat: add encoding even if .br/.gz specified (#923)

* Add handling of brotli/gzip pre-compressed files

Serving pre-compressed brotli/gzip files was not working before, because a file.br.br against the pre-compressed file.br check always returned false.

* Bump version from 14.1.1 to 14.1.2

* fix: always check the dot

This fixes an issue recently introduced where file extensions ending
with `br` are handled even when the dot does not immediately
preceded. This introduces erroneous an error when trying to access
files with other extensions ending with `br`, such as `.cbr`.

I meant to merge the previous PR with this fix included but forgot to
commit the suggestion I added in the PR review. This was merged to a
feature branch so the main branch was not affected.

* fix: put new behavior for .br/.gz behind a flag

Adds --force-content-encoding flag which must be specified to enable
the behavior of including the Content-Encoding header in the response
when a .br or .gz file is directly requested in the URL.

* test: --force-content-encoding flag

Tests whether or not Content-Encoding is present under different cases
with and without the --force-content-encoding flag set.

* doc: update manpage

* sync: package-lock.json

---------

Co-authored-by: Andreas Zeitler <andreas.zeitler@protonmail.com>
Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together.


Updates `cookie` from 0.6.0 to 0.7.1
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](jshttp/cookie@v0.6.0...v0.7.1)

Updates `express` from 4.21.0 to 4.21.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md)
- [Commits](expressjs/express@4.21.0...4.21.1)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: express
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/v2/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.29.0...v1.30.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-version: 1.30.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Tests prior to this change use a mixture of hard-coded ports and ports
found using `portfinder`. Hard-coded ports cause tests to fail depending
on the conditions of the host environment they are running on. Ports
obtained using portfinder cause stochastic port collisions because tap
runs tests in parallel; two tests might find the same open port and both
try to listen on that port simultaneously.

This change updates several tests to use ephemeral. This is accomplished
by specifying the port as `0` in the call to `.listen()`:

> If port is omitted or is 0, the operating system will assign an
> arbitrary unused port, which can be retrieved by using
> server.address().port after the 'listening' event has been
> emitted.
source: https://nodejs.org/api/net.html#net_server_listen

Since the http server is `union` with a wrapper class,
`lib/http-server.js` is updated to inlcude the new method `address()`
which allows access to the ephemeral port number that was selected.
I don't know how this wasn't here already but fortunately `.tap` has not
yet been tracked by Git.
While the underlying HTTP server does in fact throw an error when the
response will have invalid HTTP headers, this happens at runtime at the
time of the first request rather than immediately after the process is
started. This should be considered a fatal configuration error, causing
the process to exit immediately.
@rafiibrahim8 rafiibrahim8 merged commit e6a02e1 into rafiibrahim8:master Oct 25, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants