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

@easypost/api

Package Overview
Dependencies
Maintainers
0
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@easypost/api - npm Package Compare versions

Comparing version 7.5.1 to 7.5.2

4

CHANGELOG.md
# CHANGELOG
## v7.5.2 (2024-08-16)
- Fixes webhook validation when the `weight` field contains a float by converting it back into a float after conversion from a string (closes #467)
## v7.5.1 (2024-08-09)

@@ -4,0 +8,0 @@

2

package.json
{
"name": "@easypost/api",
"description": "EasyPost Node Client Library",
"version": "7.5.1",
"version": "7.5.2",
"author": "Easypost Engineering <oss@easypost.com>",

@@ -6,0 +6,0 @@ "homepage": "https://easypost.com",

@@ -123,5 +123,10 @@ import Constants from '../constants';

// Fixes Javascript's float to string conversion. See https://github.com/EasyPost/easypost-node/issues/467
const correctedEventBody = Buffer.from(eventBody)
.toString('utf8')
.replace(/("weight":\s*)(\d+)(\s*)(?=,|\})/g, '$1$2.0');
const expectedSignature = crypto
.createHmac('sha256', encodedSecret)
.update(eventBody, 'utf-8')
.update(correctedEventBody, 'utf-8')
.digest('hex');

@@ -138,3 +143,3 @@

) {
webhook = JSON.parse(eventBody.toString());
webhook = JSON.parse(correctedEventBody);
} else {

@@ -141,0 +146,0 @@ throw new SignatureVerificationError({ message: Constants.WEBHOOK_DOES_NOT_MATCH });

Sorry, the diff of this file is too big to display

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