-
Notifications
You must be signed in to change notification settings - Fork 9
Description
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.
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.
