Skip to content

Protocol reference incorrectly interpreted as status code #9

@davegraham92120

Description

@davegraham92120

MongoDB Atlas API returns headers that look like this:
HTTP/1.1 200 OK content-encoding: gzip content-type: application/json strict-transport-security: max-age=31536000; includeSubdomains; vary: Origin x-appservices-request-id: 678e9496c2789b53919f5c00 x-frame-options: DENY date: Mon, 20 Jan 2025 18:23:18 GMT content-length: 52 server: mdbws x-xgen-up-proto: HTTP/2

That last line includes a protocol reference (HTTP/2), which is incorrectly interpreted to be a status code. That causes $responseLine1 to look at the last line instead of the first, which returns an invalid status code and OK=False, when the request was successful. I did a quick fix for my edge case, which is probably not the best way to handle it.

Image

I'm guessing we should loop through and evaluate each line to see if it's a status line. I'm in the middle of time-sensitive project and wanted to report this now. I'll try to come up with a better fix for this once I have some tests to run it against.

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