From 4bc8e330fa239d1ade18a5d75ea018f1a954bfb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 3 Oct 2014 18:52:14 +0300 Subject: Remove the REST known_content_type callback This callback was simply useless. --- ROADMAP.md | 3 - doc/src/guide/rest_handlers.ezdoc | 1 - doc/src/guide/rest_start.png | Bin 118210 -> 105640 bytes doc/src/guide/rest_start.svg | 122 ++------------------------------------ doc/src/manual/cowboy_rest.ezdoc | 11 ---- src/cowboy_rest.erl | 6 +- 6 files changed, 6 insertions(+), 137 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 4b613cd..9251bad 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -52,9 +52,6 @@ functions and the new response function described above. ### REST -The `known_content_type` callback has no purpose, so it -is going to be removed. - The documentation for all REST callbacks will be updated to describe whether they can have side effects. This will allows us to build introspection tools on top of a working diff --git a/doc/src/guide/rest_handlers.ezdoc b/doc/src/guide/rest_handlers.ezdoc index 8cdd12e..1868f0a 100644 --- a/doc/src/guide/rest_handlers.ezdoc +++ b/doc/src/guide/rest_handlers.ezdoc @@ -67,7 +67,6 @@ if it is undefined, moving directly to the next step. Similarly, | generate_etag `undefined` | is_authorized `true` | is_conflict `false` -| known_content_type `true` | known_methods `[<<"GET">>, <<"HEAD">>, <<"POST">>, <<"PUT">>, <<"PATCH">>, <<"DELETE">>, <<"OPTIONS">>]` | languages_provided skip | last_modified `undefined` diff --git a/doc/src/guide/rest_start.png b/doc/src/guide/rest_start.png index 7f26464..1f1e312 100644 Binary files a/doc/src/guide/rest_start.png and b/doc/src/guide/rest_start.png differ diff --git a/doc/src/guide/rest_start.svg b/doc/src/guide/rest_start.svg index d75e1cc..076c619 100644 --- a/doc/src/guide/rest_start.svg +++ b/doc/src/guide/rest_start.svg @@ -16,7 +16,7 @@ id="svg2" version="1.1" inkscape:version="0.48.4 r9939" - sodipodi:docname="rest_options.svg" + sodipodi:docname="rest_start.svg" inkscape:export-filename="/home/essen/Dropbox/Public/drawing.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> @@ -93,7 +93,7 @@ image/svg+xml - + @@ -369,32 +369,6 @@ style="opacity:0.8;fill:#6d8e41;fill-opacity:1;fill-rule:nonzero;stroke:#6d8e41;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" sodipodi:type="star" /> - - - - @@ -629,32 +603,6 @@ style="opacity:0.8;fill:#9b3b1c;fill-opacity:1;fill-rule:nonzero;stroke:#9b3b1c;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" sodipodi:type="star" /> - - - - - known_content_type + y="812.14441">valid_entity_length valid_entity_length - ... + y="895.81165">... true - true @@ -1237,17 +1155,6 @@ id="tspan5373-9-012" x="315.26172" y="791.42102">false - false - 415 unsupported media type - 413 request entity too large + y="813.64819">413 request entity too large valid_content_headers(Req, State) -> expect(Req, State, valid_content_headers, true, - fun known_content_type/2, 501). - -known_content_type(Req, State) -> - expect(Req, State, known_content_type, true, - fun valid_entity_length/2, 415). + fun valid_entity_length/2, 501). valid_entity_length(Req, State) -> expect(Req, State, valid_entity_length, true, fun options/2, 413). -- cgit v1.2.3