Created
February 20, 2017 00:05
-
-
Save cdgraff/88f5e6449956ad9c9882e9f1962682a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sub vcl_deliver { | |
| std.log("userid:" + cookie.get("userid")); | |
| std.log("url:" + req.url); | |
| set resp.http.Access-Control-Allow-Origin = "http://your.site.here"; | |
| set resp.http.Access-Control-Allow-Credentials = "true"; | |
| if (resp.http.Content-Type ~ "application/vnd.apple.mpegurl") { | |
| # Set a userid cookie on the client that lives for 60 minutes. | |
| set resp.http.Set-Cookie = "userid=" + cookie.get("userid") + "; Expires=" + cookie.format_rfc1123(now, 60m) + "; httpOnly"; | |
| } | |
| return(deliver); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment