diff options
Diffstat (limited to 'archives/extend/attachments/20130520')
-rw-r--r-- | archives/extend/attachments/20130520/3cc045e8/attachment.html | 9 | ||||
-rw-r--r-- | archives/extend/attachments/20130520/5134ba32/attachment.html | 29 |
2 files changed, 38 insertions, 0 deletions
diff --git a/archives/extend/attachments/20130520/3cc045e8/attachment.html b/archives/extend/attachments/20130520/3cc045e8/attachment.html new file mode 100644 index 00000000..bbb81bf6 --- /dev/null +++ b/archives/extend/attachments/20130520/3cc045e8/attachment.html @@ -0,0 +1,9 @@ +<tt> +<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 19, 2013 at 10:01 PM, Eduardo Gurgel <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I want to write a cowboy middleware that works only on non-websocket requests. How can I achieve this? Is there any way that I ask the Request if this is a websocket request?<br><br> +<br></div></blockquote><div><br></div><div style>Thinking about my question, I see that the middleware (if it's behind the cowboy_handler) can't figure if the connection will be upgraded or not.�</div><div style><br><br> +</div><div style>Still, it would be cool if I could select which routes will be applied to my middleware.�</div><div style><br></div><div style>Am I making any sense? :)</div></div><div><br></div>-- <br><div dir="ltr">Eduardo<br><br> +</div><br> +</div></div><br> + +</tt> diff --git a/archives/extend/attachments/20130520/5134ba32/attachment.html b/archives/extend/attachments/20130520/5134ba32/attachment.html new file mode 100644 index 00000000..93278610 --- /dev/null +++ b/archives/extend/attachments/20130520/5134ba32/attachment.html @@ -0,0 +1,29 @@ +<tt> +<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 20, 2013 at 10:25 AM, Lo�c Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br><br> +<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 05/20/2013 01:53 PM, Eduardo Gurgel wrote:<br><br> +</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br> +<br><br> +<br><br> +<br><br> +On Sun, May 19, 2013 at 10:01 PM, Eduardo Gurgel <<a href="mailto:[email protected]" target="_blank">[email protected]</a><br></div><div class="im"><br> +<mailto:<a href="mailto:[email protected]" target="_blank">[email protected]</a>>> wrote:<br><br> +<br><br> +� � I want to write a cowboy middleware that works only on non-websocket<br><br> +� � requests. How can I achieve this? Is there any way that I ask the<br><br> +� � Request if this is a websocket request?<br><br> +<br><br> +<br><br> +Thinking about my question, I see that the middleware (if it's behind<br><br> +the cowboy_handler) can't figure if the connection will be upgraded or not.<br><br> +<br><br> +Still, it would be cool if I could select which routes will be applied<br><br> +to my middleware.<br><br> +</div></blockquote><br> +<br><br> +You have the Req which can help you do things based on host or path, and you also have the environment, which contains the name of the handler that's gonna be used if you execute your middleware after cowboy_router.<span class="HOEnZb"><font color="#888888"><br><br> +<br> +<br></font></span></blockquote><div><br></div><div style>Perfect! The environment can help me :)</div><div><br></div><div><br></div><div style>Thank you, again!</div></div><div><br></div>-- <br><div dir="ltr">Eduardo<br><br> +</div><br> +</div></div><br> + +</tt> |