circledisc
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "circledisc", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "CircleCI > Discord webhook", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ # CircleDisc |
@@ -38,3 +38,4 @@ const http = require("http"); | ||
if (port instanceof http.Server) { | ||
this.server = port || 8080; | ||
this.server = port; | ||
this.server.on("request", (req, res) => this._onRequest(req, res)); | ||
} else { | ||
@@ -49,13 +50,16 @@ this.server = http.createServer((req, res) => this._onRequest(req, res)); | ||
_onRequest(req, res) { | ||
if (req.method !== "POST" && req.url !== "/hooks/circleci") { | ||
if (req.method !== "POST" && req.url !== "/hooks/circleci" || req.) { | ||
// REEEEEE | ||
res.write("<img src='https://cdn.frankerfacez.com/emoticon/61193/4'>"); | ||
res.end(); | ||
return; | ||
} | ||
let body = ""; | ||
let body = []; | ||
req.on("data", (chunk) => { | ||
body = JSON.parse(chunk.toString()); | ||
});; | ||
body.push(chunk); | ||
}).on("end", () => { | ||
req.on("end", () => { | ||
body = Buffer.concat(body).toString(); | ||
@@ -62,0 +66,0 @@ res.write("OK") |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6879
141
3