Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response code is 0 when 401 Unauthorized with macOS #110

Open
fukusuket opened this issue Sep 17, 2023 · 0 comments
Open

response code is 0 when 401 Unauthorized with macOS #110

fukusuket opened this issue Sep 17, 2023 · 0 comments

Comments

@fukusuket
Copy link
Contributor

fukusuket commented Sep 17, 2023

Thank you for maintaining tool :)
I am reporting an issue because there is case where the response code did not give the intended result.

Describe the issue
Response code is 0 when 401 Unauthorized with macOS.

Step to Reproduce
Execute following code.

import puppy

let response = get("https://httpbin.org/basic-auth/testuser/testpassword")
echo response.code

Expected behavior
The output result is 401

Actual behavior
The output result is 0

Environment

  • OS: macOS Ventura 13.5.2
  • Puppy version 2.1.0
  • Nim version 2.0.0

Additional context
The output of curl is as follows.

% curl -I "https://httpbin.org/basic-auth/testuser/testpassword"
HTTP/2 401
date: Sun, 17 Sep 2023 12:31:01 GMT
content-length: 0
server: gunicorn/19.9.0
www-authenticate: Basic realm="Fake Realm"
access-control-allow-origin: *
access-control-allow-credentials: true

On Ubuntu 22.04, the same code returned 401, so it seems to be a macOS-only issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant