![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@significa/directus-extension-raw-body
Advanced tools
Simple Directus extension that sets the serialized request body in the express request object.
Simple Directus extension that sets the serialized request body in the express request object.
In your Directus project directory run:
npm install @significa/directus-extension-raw-body
Create an environment variable RAW_BODY_ENDPOINT_PATTERN
with a Regex Expression matching the
endpoints/routes where rawBody
will be added to the request object.
Examples:
# Matches all endpoints for a specific extension
RAW_BODY_ENDPOINT_PATTERN='^\/sample-extension\/.*$'
# Matches all endpoints (avoid: you should only set rawBody for custom endpoints)
RAW_BODY_ENDPOINT_PATTERN='^.*$'
# Matches two routes /hello-world and /sample/path
RAW_BODY_ENDPOINT_PATTERN='^(\/hello-world|\/sample\/path)$'
# Matches routes with variable input in path. Ex:
# - /sample/cats/fifi
# - /sample/cats/bob1
# - /sample/aaaa/info
# - /sample/bbbb/info
RAW_BODY_ENDPOINT_PATTERN='^(\/sample\/cats\/\D+|\/sample\/[a-z]+\/info)$'
Restart Directus for the changes to take effect.
Create a directus endpoint extension:
JS
export default (router, _) => {
router.post(
'/sample',
async (req, res, _next) => {
console.log('Raw body:', req.rawBody)
return res.json({
status: 'OK',
rawBody: req.rawBody,
})
}
)
TS
import { NextFunction, Request, Response, Router, } from 'express'
import { ApiExtensionContext } from '@directus/shared/types'
import { RequestWithRawBody } from "@significa/directus-extension-raw-body";
export default (router, extensionContext: ApiExtensionContext) => {
router.post(
'/sample',
async (req: RequestWithRawBody, res: Response, _next: NextFunction) => {
console.log('Raw body:', req.rawBody)
return res.json({
status: 'OK',
rawBody: req.rawBody,
})
}
)
})
FAQs
Simple Directus extension that sets the serialized request body in the express request object.
The npm package @significa/directus-extension-raw-body receives a total of 8 weekly downloads. As such, @significa/directus-extension-raw-body popularity was classified as not popular.
We found that @significa/directus-extension-raw-body demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.