Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@push-rpc/next

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@push-rpc/next - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

dist/utils/server.d.ts

8

dist/server/http.js

@@ -6,2 +6,3 @@ "use strict";

const logger_js_1 = require("../logger.js");
const server_1 = require("../utils/server");
async function serveHttpRequest(req, res, path, hooks, createConnectionContext) {

@@ -75,11 +76,12 @@ // if port is in options - response 404 on other URLs

function readBody(req) {
const decompressed = (0, server_1.decompressRequest)(req);
return new Promise((resolve, reject) => {
let body = "";
req.on("data", (chunk) => {
decompressed.on("data", (chunk) => {
body += chunk.toString();
});
req.on("end", () => {
decompressed.on("end", () => {
resolve(body);
});
req.on("error", (error) => {
decompressed.on("error", (error) => {
reject(error);

@@ -86,0 +88,0 @@ });

{
"name": "@push-rpc/next",
"version": "2.0.1",
"version": "2.0.2",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

@@ -31,2 +31,6 @@ ## Glossary

- [important] Importing index.js from the root of the package will import node's http package. Not good for clients.
- Browser sockets don't have 'ping' event. Need to find a different way to detect connection loss.
- Browser sockets don't have 'ping' event. Need to find a different way to detect connection loss.
## Features
- Supports compressed HTTP requests.

@@ -6,2 +6,3 @@ import * as http from "http"

import {log} from "../logger.js"
import {decompressRequest} from "../utils/server"

@@ -89,11 +90,13 @@ export async function serveHttpRequest(

function readBody(req: http.IncomingMessage) {
const decompressed = decompressRequest(req)
return new Promise<string>((resolve, reject) => {
let body = ""
req.on("data", (chunk: Buffer) => {
decompressed.on("data", (chunk: Buffer) => {
body += chunk.toString()
})
req.on("end", () => {
decompressed.on("end", () => {
resolve(body)
})
req.on("error", (error: any) => {
decompressed.on("error", (error: any) => {
reject(error)

@@ -100,0 +103,0 @@ })

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc