eris icon indicating copy to clipboard operation
eris copied to clipboard

Allow configuring RequestHandler to use HTTP instead of HTTPS

Open molenzwiebel opened this issue 3 years ago • 4 comments

My use case was to tunnel all Eris traffic through a central rate limiter (Twilight's http-proxy), which uses HTTP instead of HTTPS. Given that we can already configure the domain and base URL, being able to configure whether to use HTTPS or HTTP seemed logical.

I've named it https and enabled it by default, to ensure concious opt-out by doing https: false. A name like useHttps might be more appropriate.

Could also consider storing the request method (https or http module) as an instance variable on RequestHandler instead of doing the ternary on each request, but I figured this'd be fine.

JSDoc and TypeScript typings should be good.

molenzwiebel avatar May 01 '21 18:05 molenzwiebel

Should we not just take the protocol from the rest URL provided?

tbnritzdoge avatar May 05 '21 00:05 tbnritzdoge

The domain doesn't have a protocol prefixed. Using it would probably be neater, but it would break backwards compat.

molenzwiebel avatar May 05 '21 15:05 molenzwiebel