Skip to content

Commit e5a960f

Browse files
authored
fix: re-enable host origin for pinata (#1519)
Signed-off-by: Norman <norman@samourai.coop>
1 parent 7a93c1e commit e5a960f

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

packages/components/OptimizedImage.tsx

+2-11
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ export const OptimizedImage: React.FC<
5252
crossOrigin="anonymous"
5353
width={sourceWidth}
5454
height={sourceHeight}
55-
onError={() => {
56-
if (shouldUseFallback) {
57-
setIsFallbackError(true);
58-
return;
59-
}
60-
setIsError(true);
61-
}}
6255
style={{
6356
objectFit: "contain",
6457
borderWidth: 0,
@@ -121,10 +114,8 @@ const transformURI = (
121114
}
122115

123116
if (uri?.startsWith("ipfs://")) {
124-
// FIXME: passing the gateway token here is unsafe and people could rip our cap but the host origin method seems broken atm
125-
const gatewayAccessToken =
126-
"0Ik-SBA6O3xxcvHBRmD526aG06EEwIqwcr14MFfFveyotZmOI4v9gLfJgHW3SRFY";
127-
return `https://teritori.mypinata.cloud/ipfs/${uri.substring("ipfs://".length)}?img-width=${Math.round(width)}&img-height=${Math.round(height)}&img-fit=contain&pinataGatewayToken=${gatewayAccessToken}`;
117+
// XXX: allow passing a dev token
118+
return `https://teritori.mypinata.cloud/ipfs/${uri.substring("ipfs://".length)}?img-width=${Math.round(width)}&img-height=${Math.round(height)}&img-fit=contain`;
128119
}
129120

130121
const params = resolveParams(width, height);

0 commit comments

Comments
 (0)