Last active
December 5, 2017 08:51
-
-
Save vladimir-ivanov/4e3456da3ff0701a1ecf4c6ec6156046 to your computer and use it in GitHub Desktop.
OPTIONS preflight headers response
This file contains 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
.z.pm:{"HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: POST, GET, OPTIONS\r\nAccess-Control-Allow-Headers: Content-Type, Authorization\r\nAccess-Control-Max-Age: 86400\r\nVary: Accept-Encoding, Origin\r\nContent-Length: 0\r\nKeep-Alive: timeout=2, max=100\r\nConnection: Keep-Alive\r\nContent-Type: text/plain"} |
This file contains 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
.z.pp:{.h.hp("foo";"bar")} /add Access-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: POST, GET, OPTIONS |
This file contains 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
.z.pw:{show x; show y; y=`one} / needs to return 401 unauthorized |
This file contains 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
<html> | |
<body><title>example</title> | |
<form action=""> | |
<input type="button" value="post" onclick="return postForm()"> | |
</form> | |
<textarea id="out" rows=25 cols=80></textarea> | |
<script> | |
function postForm() { | |
let opts = {"user": "vlad", "pass": "vlad pass"}; | |
fetch('http://localhost:5001', { | |
method: 'post', | |
body: JSON.stringify(opts), | |
headers: { | |
"Content-Type": "application/json", | |
"Authorization": "Basic " + btoa("one:pass") | |
} | |
}).then(function (response) { | |
return response.json(); | |
}).then(function (data) { | |
console.log('Created Gist:', data.html_url); | |
}); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment