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

can not upload file to api route #58

Open
craigcosmo opened this issue May 20, 2024 · 4 comments
Open

can not upload file to api route #58

craigcosmo opened this issue May 20, 2024 · 4 comments

Comments

@craigcosmo
Copy link

craigcosmo commented May 20, 2024

with node-adapter I can upload file to api route

with svelte-adapter-bun I can not upload file to api route. Error: 403 forbidden

tested with the same file and size

to reproduce

create a brand new sveltekit app from command line

create an api route with POST request
create a +page.svelte in a normal route in src , in there you upload file to api route using fetch with post method.
it will fail.

@ptrxyz
Copy link

ptrxyz commented Jun 16, 2024

Can you provide a repository with a minimal demo app? @craigcosmo

@craigcosmo
Copy link
Author

here is the repo

https://github.com/craigcosmo/mytron

@KyleFontenot
Copy link

KyleFontenot commented Jul 15, 2024

@craigcosmo In your reproduction, in file /src/lib/config.ts, doesn't look like you updated the dev urls:

let apiUrl: string =
  env == 'production'
  ? 'https://contron.vn/api/'
  : 'http://localhost:2233/api/'

Changing the dev url to 'http://localhost:9955/api/' gave me a success message.

@craigcosmo
Copy link
Author

I mean it works on localhost, but not on any server, whether it's vercel or render.com

When I switched back to node apdater, the upload worked on servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants