Skip to content

Commit 3fc64d2

Browse files
takaokoujiclaude
andcommitted
fix: use Smalruby CORS proxy instead of external service
Update fetchProjectFromUrl to use Smalruby's own CORS proxy endpoint instead of cors-anywhere.herokuapp.com which returns 403 errors. Changes: - Replace external CORS proxy with https://api.smalruby.app/cors-proxy - Use proper query parameter format: ?url=<encoded_url> - Maintain all existing functionality and error handling This provides better reliability and security for loading external SB3 files from Google Drive and other cloud storage services. Related to #390 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent a3a89bc commit 3fc64d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/project-fetcher-hoc.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,12 @@ const ProjectFetcherHOC = function (WrappedComponent) {
135135

136136
async fetchProjectFromUrl (projectUrl, loadingState) {
137137
try {
138-
// Download SB3 file from URL
139-
const response = await fetch(projectUrl);
138+
// Use Smalruby CORS proxy to avoid CORS restrictions
139+
const corsProxyUrl = 'https://api.smalruby.app/cors-proxy';
140+
const proxiedUrl = `${corsProxyUrl}?url=${encodeURIComponent(projectUrl)}`;
141+
142+
// Download SB3 file from URL via Smalruby CORS proxy
143+
const response = await fetch(proxiedUrl);
140144
if (!response.ok) {
141145
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
142146
}

0 commit comments

Comments
 (0)