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.0 to 2.0.1

2

dist/server/http.js

@@ -13,3 +13,3 @@ "use strict";

const itemName = req.url.slice(path.length + 1);
const isJson = req.headersDistinct["content-type"]?.includes("application/json") ?? false;
const isJson = req.headers["content-type"]?.includes("application/json") ?? false;
const textBody = await readBody(req);

@@ -16,0 +16,0 @@ let body = isJson && !!textBody ? (0, json_js_1.safeParseJson)(textBody) : [];

@@ -27,4 +27,5 @@ "use strict";

async createConnectionContext(req) {
const header = req.headers[rpc_js_1.CLIENT_ID_HEADER];
return {
clientId: req.headersDistinct[rpc_js_1.CLIENT_ID_HEADER]?.[0] || "anon",
clientId: (Array.isArray(header) ? header[0] : header) || "anon",
};

@@ -31,0 +32,0 @@ },

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

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

@@ -30,2 +30,3 @@ ## 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.

@@ -23,3 +23,3 @@ import * as http from "http"

const isJson = req.headersDistinct["content-type"]?.includes("application/json") ?? false
const isJson = req.headers["content-type"]?.includes("application/json") ?? false
const textBody = await readBody(req)

@@ -26,0 +26,0 @@ let body = isJson && !!textBody ? safeParseJson(textBody) : []

@@ -62,6 +62,8 @@ import {CLIENT_ID_HEADER, RpcConnectionContext, RpcContext, Services} from "../rpc.js"

async createConnectionContext(req: IncomingMessage): Promise<RpcConnectionContext> {
const header = req.headers[CLIENT_ID_HEADER]
return {
clientId: req.headersDistinct[CLIENT_ID_HEADER]?.[0] || "anon",
clientId: (Array.isArray(header) ? header[0] : header) || "anon",
}
},
}

Sorry, the diff of this file is not supported yet

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