-
Notifications
You must be signed in to change notification settings - Fork 203
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
Maximum header size hit #39
Comments
Hey! 👋 A bit of background: modules support currently requires the Therefore, to add Node flags like You could definitely use Miniflare's API as you suggest though, see more details here: https://miniflare.dev/api.html. You'd just need to run your script with the right flags: // my-miniflare.mjs
import { Miniflare } from "miniflare";
const mf = new Miniflare({ ... }); node --experimental-vm-modules --max-http-header-size 15000 my-miniflare.mjs There isn't currently an easy way to have your workers at different URLs on the same port. You'd need to add CORS headers as in this example (https://developers.cloudflare.com/workers/examples/cors-header-proxy). If you only wanted to enable this during development, you could add an additional binding: if(globalThis.MINIFLARE) {
// add CORS headers
} $ node ... ./node_modules/miniflare/dist/cli.js --binding MINIFLARE=true You could also setup a reverse proxy in front of Miniflare, but adding CORS headers is a much simpler solution. |
hey thanks for getting back to me so fast. So just to make sure I understand: Option 1 Clone the repo, then run Option 2
this part you mention
I could do that EDIT: Oh Are you saying that for CORS I add the headers to my worker script and not to miniflare? If so thats cool. And then you are saying that miniflare will create the variable
Ahh ok, would be cool to pass multiple worker scripts, or a directory path, and it fires them all up on url parts based on their name or something Thanks - this tool is sweet. |
For Option 1, when you install Miniflare with
Yep, that's exactly it. Since |
Ok so I am making some good progress here. Few things not quite working for me, realise this isn't so much an "issue" with miniflare, but other user's may benefit... The following does indeed work My command is However I notice here that I should be able to set the max header size as part of the server options, with something like In effect I want the cli as it is with some customisations... my-miniflare.js looks like the following, but that isn't quite the cli as it doesn't have the
my guess though is here I could pass the aforementioned option in the I also had trouble with the CORS example previously talked about. I added my response now looks like
but that doesn't seem to cut it. Any ideas? Running their example directly fails aswell btw so had to do some detective work to see what the premise of their cors changes are, but to no avail |
Miniflare's Are there any CORS errors in your browser's JavaScript console? They may shed some light on the issue. 🕵️ |
Hey! 👋 The first pre-release of Miniflare 2 has just been released, allowing you to pass a |
I am sending large headers to my cloudflare workers and want to simulate this locally using miniflare.
With normal node its possible to allow bigger headers like
--max-http-header-size 15000
as an exampleHow can I tell miniflare to accept larger headers?
I wondered if one option was to use the sdk of miniflare and wrap it in a node app so that I then call it like
node my-miniflare.js
or something but thought I would ask for advice.While I'm here, as couldn't find anything in docs:
The text was updated successfully, but these errors were encountered: