Skip to content

Discrepancy between documentation and server response for invalid/missing API key (401 vs 403) #9

@DPende

Description

@DPende

This issue is not strictly related to the scrapegraph-js library.

Description

I have noticed a discrepancy between the documentation and the server responses, specifically regarding the HTTP response code when the API key is invalid or missing.

According to the API Reference at Error Handling page, if the key is invalid or missing, the server should return a 401 Unauthorized error. However, it always returns a 403 Forbidden error instead.

For example, here I am using an invalid key:

Image

And in this example, I am not including the key in the request header:

Image

In both cases, it returns 403.

In this repo (scrapegraph-js)

Specifically for this repository, the HTTP error mapping is wrong as a consequence.

function mapHttpError(status: number): string {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions