Skip to content
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

fix: cors preflight issue in production #178

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-storacha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
echo "NEXT_PUBLIC_W3UP_SERVICE_URL=https://up.storacha.network" >> .env
echo "NEXT_PUBLIC_W3UP_RECEIPTS_URL=https://up.storacha.network/receipt/" >> .env
echo "NEXT_PUBLIC_W3UP_PROVIDER=did:web:web3.storage" >> .env
echo "NEXT_PUBLIC_W3UP_GATEWAY_HOST=https://w3s.link" >> .env
echo "NEXT_PUBLIC_W3UP_GATEWAY_HOST=https://freeway.dag.haus" >> .env
echo "NEXT_PUBLIC_W3UP_GATEWAY_ID=did:web:w3s.link" >> .env
echo "NEXT_PUBLIC_IPFS_GATEWAY_URL=https://%ROOT_CID%.ipfs.w3s.link" >> .env
echo "NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID=prctbl_1OCJ1qF6A5ufQX5vM5DWg4rA" >> .env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
echo "NEXT_PUBLIC_W3UP_SERVICE_URL=https://up.web3.storage" >> .env
echo "NEXT_PUBLIC_W3UP_RECEIPTS_URL=https://up.web3.storage/receipt/" >> .env
echo "NEXT_PUBLIC_W3UP_PROVIDER=did:web:web3.storage" >> .env
echo "NEXT_PUBLIC_W3UP_GATEWAY_HOST=https://w3s.link" >> .env
echo "NEXT_PUBLIC_W3UP_GATEWAY_HOST=https://freeway.dag.haus" >> .env
echo "NEXT_PUBLIC_W3UP_GATEWAY_ID=did:web:w3s.link" >> .env
echo "NEXT_PUBLIC_IPFS_GATEWAY_URL=https://%ROOT_CID%.ipfs.w3s.link" >> .env
echo "NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID=prctbl_1OCJ1qF6A5ufQX5vM5DWg4rA" >> .env
Expand Down
7 changes: 6 additions & 1 deletion src/components/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ export const serviceConnection = connect<Service>({
}),
})

export const gatewayHost = process.env.NEXT_PUBLIC_W3UP_GATEWAY_HOST ?? 'https://w3s.link'
/**
* Using freeway.dag.haus/freeway-staging.dag.haus as the gateway host directly without going through w3s.link
* to avoid the need to avoid access fetch error in production due to the w3s.link CORS policy:
* - Redirect is not allowed for a preflight request.
*/
export const gatewayHost = process.env.NEXT_PUBLIC_W3UP_GATEWAY_HOST ?? 'https://freeway.dag.haus'
Loading