Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

check what's up with the dns tests in the browser and the gateway ipfs dns cmd #2416

Closed
hugomrdias opened this issue Sep 2, 2019 · 14 comments · Fixed by #2417
Closed

check what's up with the dns tests in the browser and the gateway ipfs dns cmd #2416

hugomrdias opened this issue Sep 2, 2019 · 14 comments · Fixed by #2417
Assignees
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@hugomrdias
Copy link
Member

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

@alanshaw
Copy link
Member

alanshaw commented Sep 2, 2019

PR to re-instate skipped tests #2417

@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked labels Sep 2, 2019
@alanshaw
Copy link
Member

alanshaw commented Sep 2, 2019

It is returning "403 - Forbidden"

@alanshaw
Copy link
Member

alanshaw commented Sep 3, 2019

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!

@olizilla
Copy link
Member

olizilla commented Sep 3, 2019

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

@alanshaw
Copy link
Member

alanshaw commented Sep 3, 2019

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.

@olizilla
Copy link
Member

olizilla commented Sep 3, 2019

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

@olizilla
Copy link
Member

olizilla commented Sep 3, 2019

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.

@olizilla
Copy link
Member

olizilla commented Sep 3, 2019

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.

@olizilla
Copy link
Member

olizilla commented Sep 3, 2019

See: ipfs/kubo#6204

@alanshaw
Copy link
Member

alanshaw commented Sep 3, 2019

Good detective work 🕵️‍♂️ 👍

@olizilla
Copy link
Member

olizilla commented Sep 3, 2019

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

@alanshaw
Copy link
Member

alanshaw commented Sep 3, 2019

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

@olizilla
Copy link
Member

olizilla commented Sep 3, 2019

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

@olizilla
Copy link
Member

olizilla commented Sep 4, 2019

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants