hoxy
hoxy copied to clipboard
Adds a setConfig option to hoxy
By allowing the user to setConfig, they can customise the request validProtocols, removeHeaders and nonEntityMethods with custom values.
Note: tests do not pass for me (they also fail on master), am I doing something wrong to get them working?
Thanks for taking the time to do a PR. I'm concerned since these changes would force the same configuration on every running instance of a proxy, it could create bugs in some scenarios. For example two areas in a codebase that don't really "know" about each other, trying to set config on hoxy and conflicts arising. To the extent these things should be customizable, they should be customizable per-instance, i.e. by passing options to createServer().
var proxy = hoxy.createServer({
...
validProtocols: { ... },
removeHeaders: { ... },
nonEntityMethods: { ... },
});
I realize it's a deeper change, but I think it would be the right thing to do.
~~Also, regarding tests, I haven't run them on more recent versions of Node. Have you verified the test failures are happening against only your branch, or against master also?~~
Never mind, I see you mentioned that they do fail on master.
Just pushed an update that fixed the test failures on my end. Let me know if you still run into issues.