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

@ministryofjustice/fb-jwt-client-node

Package Overview
Dependencies
Maintainers
12
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ministryofjustice/fb-jwt-client-node - npm Package Compare versions

Comparing version 0.0.34 to 0.0.35

29

lib/fb-jwt-client.js

@@ -454,3 +454,2 @@ const got = require('got')

if (requestMetricsEnd) requestMetricsEnd(getResponseLabels(response))
response.body = response.body || '{}'
return response

@@ -469,11 +468,29 @@ }

if (response.body && /^\s*$/.test(response.body)) return {}
return response.body
/*
* Return whatever has been parsed or an object
*
* `got` is transforming an undefined response body into a
* zero-length string. We handle that by returning an object
*
* Our `responseType` is JSON so we expect an object or
* an error
*/
return response.body || {}
} catch (e) {
const {response = {}} = e
if (response.statusCode < 300) {
/*
* The request was successful
*/
apiMetricsEnd(getResponseLabels(e))
if (response.body && /^\s*$/.test(response.body)) return {}
return response.body
/*
* But parsing the response failed
*/
if (e.name === 'ParseError') this.throwRequestError(500, 'EINVALIDPAYLOAD')
/*
* Otherwise, we could test for other conditions and handle them ...
* once we have encountered some (I'm sure it won't be long)
*/
this.throwRequestError(500, 'EUNKNOWN')
}

@@ -480,0 +497,0 @@

{
"name": "@ministryofjustice/fb-jwt-client-node",
"version": "0.0.34",
"version": "0.0.35",
"description": "Form Builder JSON Web Token Client (Node)",

@@ -20,3 +20,3 @@ "main": "lib/fb-jwt-client.js",

"aes256": "^1.0.4",
"got": "10.0.2",
"got": "10.0.4",
"jsonwebtoken": "^8.5.1",

@@ -23,0 +23,0 @@ "path-to-regexp": "^6.1.0"

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