Closed MartinKolarik closed 1 year ago
Please also test that all other options are also correctly applied for both scenarios.
@MartinKolarik with the current version in master:
$ go run main.go http https://cdn.jsdelivr.net/npm --method GET --limit 10 --json > /tmp/j
> NA, CA, Montreal, ASN:577, Bell Canada
> EU, RU, Moscow, ASN:48108, Sole trader Malkov Dmitrii Vladimirovich
> EU, RU, Moscow, ASN:202984, Chernyshov Aleksandr Aleksandrovich
> EU, RU, Moscow, ASN:62222, QuickSoft LLC
> EU, ES, Murcia, ASN:200845, AVATEL TELECOM, SA
> EU, BG, Sofia, ASN:61098, Akenes SA
> EU, NL, Amsterdam, ASN:60841, BerryByte Limited
> NA, US, (NY), Staten Island, ASN:26548, Purevoltage Enterprises
> EU, GB, Maidstone, ASN:5089, Virgin Media Limited
> NA, US, (TX), Dallas, ASN:30081, CacheNetworks, Inc.
$ cat /tmp/j
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Invalid URL. The URL structure is /npm/package@version/file.js
Is this the expected output ?
No, compare the following two. There should not be any difference in the output.
No piping, correct:
go run main.go http https://cdn.jsdelivr.net/npm --method GET --json
{"id":"R5vMRQ8UGC3zPhH3","type":"http","status":"finished","createdAt":"2023-05-02T11:51:47.780Z","updatedAt":"2023-05-02T11:51:48.392Z","probesCount":1,"results":[{"probe":{"continent":"EU","region":"Northern Europe","country":"GB","state":null,"city":"Maidstone","asn":50
89,"longitude":0.5167,"latitude":51.2667,"network":"Virgin Media Limited","tags":[],"resolvers":["private"]},"result":{"status":"finished","resolvedAddress":"151.101.1.229","headers":{"connection":"close","content-length":"62","access-control-allow-origin":"*","access-cont
rol-expose-headers":"*","timing-allow-origin":"*","cache-control":"public, max-age=86400, s-maxage=86400","cross-origin-resource-policy":"cross-origin","x-content-type-options":"nosniff","strict-transport-security":"max-age=31536000; includeSubDomains; preload","content-ty
pe":"text/plain; charset=utf-8","etag":"W/\"3e-rVTZaEP/IducDerMLIXX9cqTIf0\"","accept-ranges":"bytes","date":"Tue, 02 May 2023 11:51:48 GMT","age":"53136","x-served-by":"cache-fra-eddf8230061-FRA, cache-lhr7350-LHR","x-cache":"HIT, HIT","vary":"Accept-Encoding","alt-svc":"
h3=\":443\";ma=86400,h3-29=\":443\";ma=86400,h3-27=\":443\";ma=86400"},"rawHeaders":"Connection: close\nContent-Length: 62\nAccess-Control-Allow-Origin: *\nAccess-Control-Expose-Headers: *\nTiming-Allow-Origin: *\nCache-Control: public, max-age=86400, s-maxage=86400\nCross
-Origin-Resource-Policy: cross-origin\nX-Content-Type-Options: nosniff\nStrict-Transport-Security: max-age=31536000; includeSubDomains; preload\nContent-Type: text/plain; charset=utf-8\nETag: W/\"3e-rVTZaEP/IducDerMLIXX9cqTIf0\"\nAccept-Ranges: bytes\nDate: Tue, 02 May 202
3 11:51:48 GMT\nAge: 53136\nX-Served-By: cache-fra-eddf8230061-FRA, cache-lhr7350-LHR\nX-Cache: HIT, HIT\nVary: Accept-Encoding\nalt-svc: h3=\":443\";ma=86400,h3-29=\":443\";ma=86400,h3-27=\":443\";ma=86400","rawBody":"Invalid URL. The URL structure is /npm/package@version
/file.js","statusCode":400,"statusCodeName":"Bad Request","timings":{"total":225,"download":59,"firstByte":20,"dns":64,"tls":57,"tcp":21},"tls":{"authorized":true,"createdAt":"2022-12-23T10:55:14.000Z","expiresAt":"2024-01-24T10:55:13.000Z","issuer":{"C":"BE","O":"GlobalSi
gn nv-sa","CN":"GlobalSign Atlas R3 DV TLS CA 2022 Q4"},"subject":{"CN":"jsdelivr.net","alt":"DNS:jsdelivr.net, DNS:*.jsdelivr.net"}},"rawOutput":"Invalid URL. The URL structure is /npm/package@version/file.js"}}]}
Piped, broken:
go run main.go http https://cdn.jsdelivr.net/npm --method GET --json > tmp; cat tmp
> OC, AU, Sydney, ASN:202422, G-Core Labs S.A.
Invalid URL. The URL structure is /npm/package@version/file.js
ok thanks, I think I see where the issue is now