Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
parse-post
Advanced tools
A function that wraps ordinary request handler and automatically parse posts. It also protects again nuke requests.
Readme
A function that wraps ordinary request handler and automatically parse posts. It also protects again nuke requests.
Currently works with node.js v0.10.1+.
var parse_post = require("parse-post");
var route = beeline.route({
"/": function(req, res) {
"GET": function(req, res) { /*** GET Code ***/ },
"POST": parse_post(function(req, res) {
// req.body has parsed POST request body
})
}
});
http.createServer(route).listen(8014);
Example uses beeline.
require("parse-post")
-- Returns a function that expects a node.js request object and a node.js response object as the first and second parameters.require("parse-post").config(opt)
-- Creates a new version of parse-post
configured with values in by opt
:
opt.parser
-- A function that's used to parse the contents of the parse body. Defaulted to require("querystring").parse
opt.limit
-- Defines the maximum size in bytes of a post request. Defaulted to 1e6
.opt.message
-- Error message sent as response body when post request is over opt.limit
. Defaulted to "Too much".opt["error-content-type"]
-- Content type of the response sent when the post request is over opt.limit
. Defaulted to text/plain
.The easiest way to get parse-post is with npm:
npm install parse-post
Alternatively you can clone this git repository:
git clone git://github.com/xavi-/node-parse-post.git
This project is released under The MIT License.
FAQs
A function that wraps ordinary request handler and automatically parse posts. It also protects again nuke requests.
The npm package parse-post receives a total of 5 weekly downloads. As such, parse-post popularity was classified as not popular.
We found that parse-post 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.