Js-ipfs: check what's up with the dns tests in the browser and the gateway ipfs dns cmd

Created on 2 Sep 2019  ·  14Comments  ·  Source: ipfs/js-ipfs

Dns tests in the browser are failing due to bad json coming from the gateway.

Failing tests for reference https://travis-ci.com/ipfs/js-ipfs/jobs/230141268#L2549

P2 dieasy kinbug statuready

Most helpful comment

There is a PR with a fix waiting for review on the gateway infratructure. Will report back here when it gets applied.

All 14 comments

PR to re-instate skipped tests https://github.com/ipfs/js-ipfs/pull/2417

It is returning "403 - Forbidden"

You can use https://ipfs.io/ipfs/QmNrnVzJT3oQFNFWUSw4v1DxvRQfEzhXUtNk8CdCqhNzTh to check.

I get the following response:

Screenshot 2019-09-03 at 11 05 16

...yet, if I paste https://ipfs.io/api/v0/dns?arg=ipfs.io into my browser URL bar it works!

not sure I follow you @alanshaw the screenshot shows a 403 on https://ipfs.io/api/v0/dns?arg=ipfs.io, do you get a 200 or a 403 on that url? I get a 403

Screenshot 2019-09-03 at 11 18 17

Ok this is weird, two windows same URL I get different results:

Screenshot 2019-09-03 at 11 27 04

One of these nodes is not configured like the others.

oh me oh my... can you see the x-ipfs-pop response header on the two requests in the network tab?

hmm could it be related to referer header? If i click the link, i get 403. If I paste the url into a fresh tab, I get 200.

ok so, i think this is go-ipfs adding it's extra referer check... @lidel do you know where that check is? Basically go-ipfs adds an extra check for referer if you disable all API CORS headers in config, which we recently changed on the gateways.

Good detective work 🕵️‍♂️ 👍

Thanks! It's unclear to me why this would fail in the tests tho...

They are browser tests that are failing - they have a referrer.

There is a PR with a fix waiting for review on the gateway infratructure. Will report back here when it gets applied.

@alanshaw the change has been deployed to all the gateways. I now get a 200 with a sensible response on requests to https://ipfs.io/api/v0/dns?arg=ipfs.io with a referer header.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daviddias picture daviddias  ·  3Comments

OliverUv picture OliverUv  ·  3Comments

daviddias picture daviddias  ·  3Comments

daviddias picture daviddias  ·  3Comments

ya7ya picture ya7ya  ·  3Comments