Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@httpland/http-middleware
Advanced tools
HTTP middleware specification
Define standard HTTP middleware specifications. This is intended to increase the interoperability of the HTTP library's own middleware.
It consists only of the web standards stack and is compatible with many browsers.
Middleware interfaces can be defined in TypeScript as follows:
interface Middleware {
(request: Request, next: Handler): Response | Promise<Response>;
}
interface Handler {
(request: Request): Response | Promise<Response>;
}
Middleware
has the following features:
Compliant with Fetch API.
Compliant with Handler
.
Handler
is a powerful interface for handling HTTP requests. The Middleware
is purely an extension and compatibility with Handler
.
It is a pure function.
Middleware
is a pure function that returns a value. Implementations are
expected to have no side effects.
It is self-contained.
It can handle upstream.
It can handle downstream.
It can handle next handler.
See chain-handler for a concrete implementation that can handle middleware
Copyright © 2023-present httpland.
Released under the MIT license
FAQs
HTTP middleware specification
We found that @httpland/http-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.