diff options
Diffstat (limited to '_build/static/archives/extend/attachments/20130419/bf0e8ef9/attachment.html')
-rw-r--r-- | _build/static/archives/extend/attachments/20130419/bf0e8ef9/attachment.html | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/_build/static/archives/extend/attachments/20130419/bf0e8ef9/attachment.html b/_build/static/archives/extend/attachments/20130419/bf0e8ef9/attachment.html new file mode 100644 index 00000000..8b3834c9 --- /dev/null +++ b/_build/static/archives/extend/attachments/20130419/bf0e8ef9/attachment.html @@ -0,0 +1,8 @@ +<tt> +<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi guys,</div><div><br></div><div>So, I thought I had this resolved, as I managed to get it working locally, but across different local domains (<a href="http://test.localhost.com">test.localhost.com</a> and <a href="http://cowboy.localhost.com">cowboy.localhost.com</a>). However, now I've deployed my app to a VM, I simply can't get CORS working in Cowboy. Here's the OPTIONS response from Chrome's console:</div><div><br></div><div><br></div><div><ol class="outline-disclosure" tabindex="0" style="box-sizing: border-box; font-size: 11px; list-style-type: none; -webkit-padding-start: 12px; margin: 0px; outline: none; font-family: 'Lucida Grande', sans-serif; background-color: rgb(255, 255, 255); "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Request URL:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://www.example.com/">http://www.example.com/</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Request Method:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">OPTIONS</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Status Code:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">200 OK</div></li><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;">Request Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view source</span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Accept:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">*/*</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Accept-Charset:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">ISO-8859-1,utf-8;q=0.7,*;q=0.3</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Accept-Encoding:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">gzip,deflate,sdch</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Accept-Language:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">en-US,en;q=0.8</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Request-Headers:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">origin, method, content-type</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Request-Method:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">POST</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Connection:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">keep-alive</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Host:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://www.example.com">www.example.com</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Origin:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://test.localhost.com:8889">http://test.localhost.com:8889</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Referer:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://test.localhost.com:8889/">http://test.localhost.com:8889/</a></div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">User-Agent:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31</div></li></ol><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;">Response Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view source</span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Allow-Headers:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">Content-Type, X-Requested-With, Origin, Method</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Allow-Methods:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">GET, POST, OPTIONS</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Access-Control-Allow-Origin:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">*</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">connection:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">keep-alive</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">content-length:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">0</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">date:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">Fri, 19 Apr 2013 14:40:00 GMT</div></li><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">server:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">Cowboy</div></li></ol></ol><div><br></div></div><div>And then this is the POST response:</div><div><br></div><div><ol class="outline-disclosure" tabindex="0" style="box-sizing: border-box; font-size: 11px; list-style-type: none; -webkit-padding-start: 12px; margin: 0px; outline: none; font-family: 'Lucida Grande', sans-serif; background-color: rgb(255, 255, 255); "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word;"><div class="header-name" style="box-sizing: border-box; color: rgb(84, 84, 84); display: inline-block; margin-right: 0.5em; font-weight: bold; vertical-align: top; white-space: pre-wrap;">Request URL:</div><div class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; "><a href="http://www.example.com/">http://www.example.com/</a></div></li><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;">Request Headers<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view parsed</span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><span class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">POST <a href="http://www.example.com/">http://www.example.com/</a> HTTP/1.1<br> +Origin: <a href="http://test.localhost.com:8889">http://test.localhost.com:8889</a><br> +Referer: <a href="http://test.localhost.com:8889/">http://test.localhost.com:8889/</a><br> +method: POST <a href="http://www.example.com/">http://www.example.com/</a> HTTP/1.1<br> +User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31<br> +content-type: application/x-www-form-urlencoded</span></li></ol><li title="" class="parent expanded" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -12px; word-wrap: break-word; -webkit-user-select: none; font-weight: bold;">Form Data<span class="header-toggle" style="box-sizing: border-box; display: inline; margin-left: 30px; font-weight: normal; color: rgb(115, 115, 115);">view parsed</span></li><ol class="children expanded" style="box-sizing: border-box; position: relative; margin: 0px; cursor: default; min-width: 100%; padding: 2px 6px !important; list-style-type: none; -webkit-padding-start: 12px; "><li title="" style="box-sizing: border-box; padding: 0px 0px 0px 14px; margin-top: 1px; margin-left: -2px; word-wrap: break-word; white-space: nowrap;"><span class="header-value source-code" style="box-sizing: border-box; font-family: Menlo, monospace; white-space: pre-wrap; display: inline; margin-right: 100px; word-break: break-all; margin-top: 1px; ">data={"Type":"auth_request","Authentication":"public","Authorization":null,"Domain":"<a href="http://www.example.com">www.example.com</a>","Application":"test_app","Ident":"lee"}</span></li></ol></ol><div><br></div></div><div>I am setting {<<"Access-Control-Allow-Origin">>, <<"*">>} in the headers param of cowboy_req:reply and the cowboy_req:set_resp_header, but neither seems to be working. Can anyone spot what I might be doing wrong?</div><div><br></div><div>The cowboy_req:set_resp_header is happening in the handle� So</div><div><br></div><div><div>handle(Req, State) -></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Reply = case cowboy_req:method(Req) of</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<<"POST">>, Req2} -></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Req3 = cowboy_req:set_resp_header(<<"Access-Control-Allow-Origin">>, <<"*">>, Req2),</div></div><div>[snip]</div><div><br></div><div><br></div><div>Thanks,</div><div>Lee</div><div><br></div></body></html> +</tt> |