Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@alterior/express
Advanced tools
Access Express state within an Alterior app.
@alterior/web-server
provides WebEvent.request
which exposes the HTTP request object of the underlying web server framework being used. Alterior supports more than one framework, including express
and fastify
. Technically the minimum shape of WebEvent.request
is that of the request
object defined by the Node.js http
module. As an app developer which uses Express as the server framework in my Alterior app, I want to access WebEvent.request
with a Typescript type that exposes all that Express provides, not just as a generic Node.js http
request object. I don't want to manually cast this object whenever I use it.
Since WebEvent.request
is static (using the HTTP request's Zone to determine the appropriate value), we can create new ways to access this value which are appropriately typed.
Splitting this functionality into a specific package lets us remove unused code when not using Express.
import { ExpressContext } from '@alterior/express';
// ...
@WebService()
export class MyService {
@Get()
info() {
console.log(`user agent is: ${ExpressContext.request.header('User-Agent')}`);
}
}
v3.10.2
@/web-server
Content-Type
passed does not match the typical
content type associated with the expected body format. For instance, when expecting JSON (the default), the body
would only be parsed when the Content-Type
header was application/json
. When expecting text (ie when @Body()
has type string
), the body would only be parsed when the Content-Type
header was text/plain
. This is unexpected,
since Alterior provides no manner to validate the Content-Type
field without using custom middleware. Now the body
is parsed as the expected type regardless of Content-Type
.FAQs
Access Express state within an Alterior app
The npm package @alterior/express receives a total of 29 weekly downloads. As such, @alterior/express popularity was classified as not popular.
We found that @alterior/express demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.