<div dir="ltr">Great, thanks.<div><br></div><div>I saw some changes "from 422 to 400" in recent versions (PUT and POST). Thanks for the heads up. As long as they're document, no harm shall come of these changes.</div>
<div><br></div><div>In any case, if I see it happen very often live I'll "protect" it agains the _bad_ header :-).</div><div><br></div><div>Cheers.</div><div><br></div><div>- Paulo F. Oliveira</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 8 July 2014 14:21, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Parsing of any header may crash. Some may also return an error tuple, though that behavior slowly changes and it will always crash in 2.0. So just wrap the call around a try/catch if you need to handle the error.<br>
<br>
Note that at this exact moment I'm working on returning 400 instead of 500 automatically when parsing headers end up crashing (and possibly other situations later on).<div><div class="h5"><br>
<br>
On 07/08/2014 03:17 PM, Paulo F. Oliveira wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hello, y'all.<br>
<br>
I'm using HTTP Basic Auth in my API. While calling<br>
cowboy_req:parse_header(<<"<u></u>authorization>>", ... with an _invalid_<br>
Authorization header such as "Authorization: Basic Test1" I get an error<br>
500 back and an error log message on the server.<br>
<br>
1. Is this the expected behavior? [if I understand correctly, my request<br>
is going through authorization(UserPass, Type = <<"basic">>) and this<br>
has no check for the string being correctly encoded]<br>
<br>
2. what would be the best way to guard against this "error"?<br>
<br>
Thanks.<br>
<br>
- Paulo F. Oliveira<br>
<br>
<br></div></div>
______________________________<u></u>_________________<br>
Extend mailing list<br>
<a href="mailto:Extend@lists.ninenines.eu" target="_blank">Extend@lists.ninenines.eu</a><br>
<a href="https://lists.ninenines.eu/listinfo/extend" target="_blank">https://lists.ninenines.eu/<u></u>listinfo/extend</a><br>
<br><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Loïc Hoguin<br>
<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br>
</font></span></blockquote></div><br></div>