I have simple vuejs application. In the main.js I have something like:
import Vue from "vue";
import App from "./App.vue";
import router from "./router/routes";
import store from "./store/root";
import vuetify from "./plugins/vuetify";
import { RootActions } from "./constants";
import axios from "axios";
axios.get("https://api.github.com/users/mzabriskie").then(function(response) {
console.log({ headers: response.headers });
});
In the chrome console log I got these:
However in https://runkit.com/greenlaw110/5e92363de9be35001ab0481e with exactly the same code, I have much more headers printed out:
Question:
- Why there is such a big difference between axios running in vuejs and a pure nodejs environment?
- What I really want is to get the
Authorization
header of the response in my VueJs application, is this really doable in any way? (Note I have already putAuthorization
in theAccess-Control-Expose-Headers
of the response to preflight request
Refer: