-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
relative links in files not added #86
Comments
@autonome it doesn't seem to be a problem of Take this hash for example: On infura.io:
On ipfs.io:
Hope it helps! |
Hm, so this is an Infura problem? These types of gateway differences are exactly the type of incompatibility that trips up devs trying to do very basic things. |
@lidel ^ Do we collect "developer adoption blockers" like this anywhere? It seems like we'd want gateways and companion behavior to be standardized. Do we have a spec for expected behavior? |
@autonome I collect issues/bugs/caveats around HTTP semantics in ipfs/in-web-browsers#132, and want to use it as a seed to create "interop gateway tests" (ipfs/interop#76) that our and third party gateways could run to ensure they are compliant with "public gateway standard". (Not sure if its under maintenance or gateway-as-a-product. Something to discuss when planning OKRs for next quarter) That being said, path Assuming your assets are in <link rel="stylesheet" href="./assets/main.css"> |
@lidel on the example I linked below, the paths are explicitly relative, yes. |
Indeed, I see there are two things at play here, which muddies the waters:
@autonome I believe (2) should go away if (1) is solved – are you making HTML by hand, or generating it? |
I deployed my pet-shop using ipfs-deploy, here is the error:
https://ipfs.io/ipfs/QmT6SgXKChuzz9nCTu8ZNtc8y7wLR3DjvH3rsEkcreiSDG/ Any ideas? |
@wakqasahmed hey! You seem to be loading the file |
@hacdias may be my eyes are failing to see it, but can you explain how the following is wrong. I am loading Here is the IPFS explorer details: |
@wakqasahmed as far as I understand, So, if you're on:
Then,
if that js file will only be opened at that location, I'd suggest you to change You might want to take advantage of HTML |
Hmmm, so I made a new example testing loading external stylesheet and iframe with both raw relative path ("style.css") and dot slash ("./style.css"): For first one I did "ipfs add -r ." in the directory and then typed "https://ipfs.io/ipfs/" in the url bar and pasted in the CID: https://ipfs.io/ipfs/QmaXPQ28xM7h8AjnbJ8cD6Ux4mgvqtwGRYjgsxEPQ6kJTX/ While still in the same dir, I did "ipfs-deploy .", and it automatically opened a new tab with: https://ipfs.infura.io/ipfs/QmaXPQ28xM7h8AjnbJ8cD6Ux4mgvqtwGRYjgsxEPQ6kJTX Notice the difference? The ipfs.io gateway appends a trailing slash. If you remove it and reload, the gateway re-adds it. The content loads correctly in the ipfs.io gateway. However the Infura URL does not load either relative path link, and does not automatically add a slash to the end. If you manually add a slash, the content loads correctly in Infura URL: https://ipfs.infura.io/ipfs/QmaXPQ28xM7h8AjnbJ8cD6Ux4mgvqtwGRYjgsxEPQ6kJTX/ So an easy fix in ipfs-deploy is to add the slash at the end of the URL opened by the tool. Follow-ups could be to write a gateway spec for path handling, and file an issue with Infura about this behavior. |
Removes the need for internal redirect done by gateway and closes #86 on gateways that override that behavior. License: MIT Signed-off-by: Marcin Rataj <[email protected]>
Removes the need for internal redirect done by gateway and closes #86 on gateways that override that behavior. License: MIT Signed-off-by: Marcin Rataj <[email protected]>
Thank you @autonome!
|
If I upload a dir of a basic static website (a basic html, js and css file) with ipfs-deploy, even though the js/css files are relatively linked I get this error when viewing the resulting hash:
Same website works fine when I do
ipfs add -r .
.The text was updated successfully, but these errors were encountered: