Created
December 6, 2018 05:10
-
-
Save tnorthcutt/2a0dd75fc6dc8f5defc05605009bf41b to your computer and use it in GitHub Desktop.
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
setPluginUrl() { | |
// Deleting the default header | |
delete window.axios.defaults.headers.common['X-CSRF-TOKEN']; | |
// Calling the method that fetches the data from Github | |
this.fetchUrl().then(data => { | |
this.pluginUrl = data; | |
}); | |
// Reset the axios default headers | |
window.axios.defaults.headers.common = { | |
'X-Requested-With': 'XMLHttpRequest', | |
'X-CSRF-TOKEN': Spark.csrfToken | |
}; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment