Skip to content

Instantly share code, notes, and snippets.

@tnorthcutt
Created December 6, 2018 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnorthcutt/2a0dd75fc6dc8f5defc05605009bf41b to your computer and use it in GitHub Desktop.
Save tnorthcutt/2a0dd75fc6dc8f5defc05605009bf41b to your computer and use it in GitHub Desktop.
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