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

@octokit/rest

Package Overview
Dependencies
Maintainers
3
Versions
297
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/rest - npm Package Compare versions

Comparing version 15.1.0 to 15.1.1

9

lib/endpoint/index.js

@@ -21,4 +21,8 @@ 'use strict'

function restEndpoint (options) {
// lowercase header names (#760)
options.headers = mapKeys(options.headers, (value, key) => key.toLowerCase())
options = defaultsDeep({}, options, DEFAULTS)
let method = options.method
let method = options.method.toLowerCase()
let baseUrl = options.baseUrl

@@ -30,5 +34,2 @@ let url = options.url

method = method.toLowerCase()
headers = mapKeys(headers, (value, key) => key.toLowerCase())
// replace :varname with {varname} to make it RFC 6570 compatible

@@ -35,0 +36,0 @@ url = url.replace(/:([a-z]\w+)/g, '{+$1}')

module.exports = apiMethod
const defaultsDeep = require('lodash/defaultsDeep')
const mapKeys = require('lodash/mapKeys')

@@ -8,2 +9,5 @@ const validate = require('./validate')

function apiMethod (octokit, endpointDefaults, endpointParams, options, callback) {
// lowercase header names (#760)
options.headers = mapKeys(options.headers, (value, key) => key.toLowerCase())
const endpointOptions = defaultsDeep(options, endpointDefaults)

@@ -10,0 +14,0 @@

@@ -60,3 +60,3 @@ 'use strict'

if (!contentType || /^text\//.test(contentType)) {
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
return response.text()

@@ -63,0 +63,0 @@ }

@@ -79,3 +79,3 @@ 'use strict'

const contentType = response.headers['content-type']
const contentType = response.headers['content-type'] || ''

@@ -88,3 +88,3 @@ if (data.length === 0) {

if (contentType && contentType.indexOf('application/json') !== -1) {
if (contentType.indexOf('application/json') !== -1) {
return resolve({

@@ -96,3 +96,3 @@ meta: response.headers,

if (contentType && /^text\//i.test(contentType)) {
if (/^text\/|charset=utf-8$/i.test(contentType)) {
return resolve({

@@ -99,0 +99,0 @@ meta: response.headers,

{
"name": "@octokit/rest",
"version": "15.1.0",
"version": "15.1.1",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public",

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