You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to access the list of all commits in a given repo in a Vue app using axios.
My Gitea server works fine, accessing the info via curl works, even in Chrome I get the expected headers (see screenshot), but the cors settings prevent the Javascript, or especially axios to access the data.
So, I need to tell Gitea to send X-Total in the Access-Control-Allow-Headers, I already glimpsed through the code, tried to change it myself, only to find out later that it was the part related to the general http stuff, not the API.
[x]
):Description
I already postet some information here:
#6408
I try to give a summary.
I want to access the list of all commits in a given repo in a Vue app using axios.
My Gitea server works fine, accessing the info via curl works, even in Chrome I get the expected headers (see screenshot), but the cors settings prevent the Javascript, or especially axios to access the data.
Here are some background infos:
https://stackoverflow.com/questions/37897523/axios-get-access-to-response-header-fields
So, I need to tell Gitea to send X-Total in the Access-Control-Allow-Headers, I already glimpsed through the code, tried to change it myself, only to find out later that it was the part related to the general http stuff, not the API.
That is part of my code:
async fetchData() { this.isLoading = true; axios.get(
https://git.24unix.net:3000/api/v1/repos/24unix.net/yyyy/commits?page=${this.currentPage}&limit=10`,{
headers: {
Authorization: 'token ' + "bfebd3123cyyyyyyyyyyyyyyy34abe46f1a",
}
})
.then((response) => {
`
Response headers just contain the Content-Type.
Chrome receives the relevant headers:
The text was updated successfully, but these errors were encountered: