GithubHelp home page GithubHelp logo

Comments (4)

dfandrich avatar dfandrich commented on May 11, 2024 1

from curl.

bagder avatar bagder commented on May 11, 2024

The fault filter abort text is not from curl, it is body content from the server.

from curl.

bagder avatar bagder commented on May 11, 2024

This case is really a matter of "garbage in, garbage out". It is difficult for curl to know when the garbage input is intended or not.

from curl.

sanjaypujare avatar sanjaypujare commented on May 11, 2024

I understand. Thanks for fixing it. One more thing that confused me. With the bad unicode character(s) and with -v option I see:

curl -v -i 10.1.2.9 -H “host: store.example.com”
*   Trying 10.1.2.9:80...
* Connected to 10.1.2.9 (10.1.2.9) port 80 (#0)
> GET / HTTP/1.1
> Host: 10.1.2.9
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found
< content-length: 18
content-length: 18
< content-type: text/plain
content-type: text/plain
< date: Thu, 28 Mar 2024 20:12:14 GMT
date: Thu, 28 Mar 2024 20:12:14 GMT
< via: 1.1 google
via: 1.1 google

< 
* Connection #0 to host 10.1.2.9 left intact
fault filter abort* Could not resolve host: store.example.xn--com-9o0a
* Closing connection 1
curl: (6) Could not resolve host: store.example.xn--com-9o0a

But with the right quote character(s):

curl -v -i 10.1.2.9 -H "host: store.example.com"
*   Trying 10.1.2.9:80...
* Connected to 10.1.2.9 (10.1.2.9) port 80 (#0)
> GET / HTTP/1.1
> Host: store.example.com
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 401 Unauthorized
HTTP/1.1 401 Unauthorized
< date: Thu, 28 Mar 2024 20:12:39 GMT
date: Thu, 28 Mar 2024 20:12:39 GMT
< via: 1.1 google
via: 1.1 google
< content-length: 0
content-length: 0

< 
* Connection #0 to host 10.1.2.9 left intact

The 401 Unauthorized is expected in the second example. But the questions are:

  • who is generating the error "Could not resolve host: store.example.xn--com-9o0a" in the first case? It looks like curl didn't send any of this stuff to the server so it must have been from curl itself
  • because of the -H argument curl should have treated the following argument only as header content to be included in the request. But for some reason it treated the whole string “host: store.example.com” as a hostname to be resolved. Is that correct?

from curl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.