Hacker News new | past | comments | ask | show | jobs | submit login

Can confirm:

    $ curl -vvv -H 'Host: registry.npmjs.org:443' https://registry.npmjs.org:443
    > GET / HTTP/1.1
    > Host: registry.npmjs.org:443
    > User-Agent: curl/7.54.0
    > Accept: */*
    > 
    < HTTP/1.1 418 I'm a teapot
    < Date: Tue, 29 May 2018 03:52:16 GMT
    < Content-Type: text/plain;charset=UTF-8
    < Content-Length: 53
    < Connection: keep-alive
    < Set-Cookie: __cfduid=d3f8dd8d2121ede348194ee142443bccc1527565936; expires=Wed, 29-May-19 03:52:16 GMT; path=/; domain=.registry.npmjs.org; HttpOnly; Secure
    < Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    < Server: cloudflare
    < CF-RAY: 422601de4bf49fc6-IAD
    < 
    {"error":"got unknown host (registry.npmjs.org:443)"}
Per RFC 7230, ยง5.4 (https://tools.ietf.org/html/rfc7230#section-5.4), the port is optional if it's the default for the URI (:80 for http, :443 for https), but nowhere in the spec does it say it's an error to include a redundant port specifier. The registry server is likely noncompliant here, and it definitely should not be throwing 418 here. (400 would be appropriate if the Host header was malformed - but that's not even the case here).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: