sumo_rest icon indicating copy to clipboard operation
sumo_rest copied to clipboard

Generic cowboy handlers to work with Sumo

Results 11 sumo_rest issues
Sort by recently updated
recently updated
newest added

Cowboy to 2.4.0 in particular, but the others as well.

when the content-type is like `application/json; charset=utf8` sumo_rest fails in sr_entities_handler:content_types_accepted/2 Example ```erlang Headers = #{ basic_auth => {Name, "pwd"} , => }, ct:comment("Create the session"), #{status_code := 201, body...

bug

sumo_rest appears to generate atoms dynamically based on the query passed in the URL - [here](https://github.com/inaka/sumo_rest/blob/7e1a494cf63c4732bde7f4dcee6b198f8441e144/src/sr_entities_handler.erl#L119). That means a malicious user or a defective client software may cause atom exhaustion...

Currently sumo_rest assumes the body of the request to be around 1MB, or crash otherwise. https://github.com/inaka/sumo_rest/blob/7e1a494cf63c4732bde7f4dcee6b198f8441e144/src/sr_request.erl#L31 https://ninenines.eu/docs/en/cowboy/1.0/manual/cowboy_req/index.html#request_body_related_exports

Please refer to: https://github.com/inaka/sumo_rest/pull/88#issuecomment-286206672 https://github.com/inaka/sumo_rest/pull/88#issuecomment-286206969

Used e.g. in: https://github.com/inaka/sumo_rest/blob/31b33efd327066c7fe1cfdbde624da87a2bc7120/README.md#sessions https://github.com/inaka/sumo_rest/blob/31b33efd327066c7fe1cfdbde624da87a2bc7120/src/sr_state.erl#L24

We can add a `binding_id` property to the trail options for the handlers and use that instead of assuming the parameter is always called `:id`. That property might default to...