<div dir="ltr">The programmer's input is not a string. It is a match pattern, so you can use 'or', '_', etc.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 4, 2013 at 6:30 AM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@ccs.neu.edu" target="_blank">samth@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why not normalize this at the other end (ie, normalize the provided<br>
string as well as the actual method) so that "GET" as well as "get"<br>
will work?<br>
<span class="HOEnZb"><font color="#888888"><br>
Sam<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Fri, Jan 4, 2013 at 7:45 AM, <<a href="mailto:jay@racket-lang.org">jay@racket-lang.org</a>> wrote:<br>
> jay has updated `master' from aa5f2e7875 to c07ff948ee.<br>
> <a href="http://git.racket-lang.org/plt/aa5f2e7875..c07ff948ee" target="_blank">http://git.racket-lang.org/plt/aa5f2e7875..c07ff948ee</a><br>
><br>
> =====[ One Commit ]=====================================================<br>
> Directory summary:<br>
> 100.0% collects/web-server/scribblings/<br>
><br>
> ~~~~~~~~~~<br>
><br>
> c07ff94 Jay McCarthy <<a href="mailto:jay@racket-lang.org">jay@racket-lang.org</a>> 2013-01-04 05:44<br>
> :<br>
> | Fixes PR13406<br>
> :<br>
> M collects/web-server/scribblings/dispatch.scrbl | 11 +++++++++--<br>
><br>
> =====[ Overall Diff ]===================================================<br>
><br>
> collects/web-server/scribblings/dispatch.scrbl<br>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
> --- OLD/collects/web-server/scribblings/dispatch.scrbl<br>
> +++ NEW/collects/web-server/scribblings/dispatch.scrbl<br>
> @@ -118,6 +118,7 @@ or else the filesystem server will never see the requests.<br>
> [maybe-method<br>
> code:blank<br>
> (code:line #:method method)]<br>
> + [method pat]<br>
> [maybe-else-clause<br>
> code:blank<br>
> [else else-fun]])<br>
> @@ -137,9 +138,15 @@ the @racket[dispatch-fun] given as its first argument.<br>
> @racket[(next-dispatcher)] to signal to the Web Server that this<br>
> dispatcher does not apply.<br>
><br>
> - If any @racket[_method] is left out, it assumed to apply to requests<br>
> -without methods and GET methods.<br>
> + The @racket[_method] syntax is used in a @racket[match] expression to<br>
> +match the @racket[request-method] part of the incoming request<br>
> +object. However, since HTTP allows methods to use any case, the byte<br>
> +string from @racket[request-method] is normalized to a lower-case<br>
> +string. Thus, valid patterns are things like: @racket["get"],<br>
> +@racket["post"], @racket["head"], @racket[(or "get" "post")], etc.<br>
><br>
> + If @racket[_method] is left out, it assumed to apply to requests<br>
> +without methods and GET methods.<br>
> }<br>
><br>
> @defform[<br>
</div></div></blockquote></div><br></div>