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

Status_Code Field not included when status code of 000 returned #1752

Closed
meme-lord opened this issue Jun 7, 2024 · 0 comments · Fixed by #1760
Closed

Status_Code Field not included when status code of 000 returned #1752

meme-lord opened this issue Jun 7, 2024 · 0 comments · Fixed by #1760
Assignees
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@meme-lord
Copy link
Contributor

httpx version: v1.6.3

Some services can return a status code of 000 but httpx simply doesn't include the status_code field when this occurs

Current Behavior:

httpx -json -u http://44.217.71.211:80

returns

{"timestamp":"2024-06-07T14:07:44.854709513+01:00","port":"80","url":"http://44.217.71.211:80","input":"http://44.217.71.211:80","scheme":"http","webserver":"awselb/2.0","content_type":"text/html","method":"GET","path":"/","time":"350.934693ms","a":["44.217.71.211"],"tech":["Amazon ELB","Amazon Web Services","PHP:8.1.4"],"words":8,"lines":1,"content_length":91,"failed":false,"knowledgebase":{"PageType":"nonerror","pHash":0}}

Expected Behavior:

httpx -json -u http://44.217.71.211:80

returns

{"status_code":0,"timestamp":"2024-06-07T14:07:44.854709513+01:00","port":"80","url":"http://44.217.71.211:80","input":"http://44.217.71.211:80","scheme":"http","webserver":"awselb/2.0","content_type":"text/html","method":"GET","path":"/","time":"350.934693ms","a":["44.217.71.211"],"tech":["Amazon ELB","Amazon Web Services","PHP:8.1.4"],"words":8,"lines":1,"content_length":91,"failed":false,"knowledgebase":{"PageType":"nonerror","pHash":0}}

Other material:

curl -v http://44.217.71.211:80
*   Trying 44.217.71.211:80...
* Connected to 44.217.71.211 (44.217.71.211) port 80
> GET / HTTP/1.1
> Host: 44.217.71.211
> User-Agent: curl/8.8.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 000
< Server: awselb/2.0
< Date: Fri, 07 Jun 2024 13:07:50 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 91
< Connection: keep-alive
< X-Powered-By: PHP/8.1.4
@meme-lord meme-lord added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jun 7, 2024
@dogancanbakir dogancanbakir self-assigned this Jun 7, 2024
@dogancanbakir dogancanbakir linked a pull request Jun 10, 2024 that will close this issue
@Mzack9999 Mzack9999 added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Jun 11, 2024
@ehsandeep ehsandeep added this to the httpx v1.6.4 milestone Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants