Skip to content

CoreAPI throws a TypeError when contentType is null #5059

@bluesurfer

Description

@bluesurfer

When the API returns no response (like after a delete request) the coreapi javascript client library throws a TypeError: Cannot read property 'toLowerCase' of null. The problem is in utils.js:

const negotiateDecoder = function (decoders, contentType) {
  if (contentType === undefined) {
    return decoders[0]
  }

const fullType = contentType.toLowerCase().split(';')[0].trim() // <- error here

We probably should add the case catching contentType === null?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy