Skip to content

Master#10

Open
rafiibrahim8 wants to merge 35 commits intocustomizedfrom
master
Open

Master#10
rafiibrahim8 wants to merge 35 commits intocustomizedfrom
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

jwetzell and others added 30 commits October 18, 2023 09:58
Version 14.11.0 wasn't working due to what appears to be a broken
dependency. I think this might be related to tapjs/tapjs/issues/1037.
The ifError alias for error in tapjs appears to no longer exist.
This one was rather strange. These tests fail even if parallel test
running is disabled (tap --jobs=1). Explicitly listening to a different
port on each test case solved the issue. I then tried waiting for the
next event cycle using a setTimeout(..., 0) on t.end and this actually
worked. I suspect then that the server doesn't really "close" until the
event loop turns once more - very interesting.
After the previous changes there were a few lingering asserts that
didn't match the names in the newest version of tap. These were
relatively trivial to fix, although interestingly the meaning of the
'includes' synonym changed at some point from "match" to "has"; these
tests were written at the time "includes" meant "match".
- Change --help option output
- Accept empty header to conform to RFC 7230 (-H "empty-header" or
  -H "empty-header:")
The link to the license was incorrect
…y#837)

* Add baseDir option, add --baseDir flag to cli options to specify base path

* add path to logged URLs

* Address feedback from @thornjad, add --base-dir flag

* base-dir tests

---------

Co-authored-by: Jesse Ditson <jesse.ditson@gmail.com>
Co-authored-by: Jesse Ditson <jditson@quip.com>
Co-authored-by: max.sagan <max.sagan@yieldbroker.com>
Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>
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 http-party#810
Verify that interface filtering handles both string and numeric
family values from `os.networkInterfaces()` across Node versions.

Related to http-party#810
Adds a media query for `prefers-color-scheme` to make directory listings more consistent with the color scheme of the environment.
…party#927)

* feat: add encoding even if .br/.gz specified (http-party#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>
dependabot Bot and others added 5 commits September 30, 2025 14:53
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.
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.