Skip to content

Commit

Permalink
fix: configure fetch to send cookies
Browse files Browse the repository at this point in the history
Previously, when XMLHttpRequest was used, cookies ware sent
when getting /-/verdaccio/logo & /-/verdaccio/packages

After switching to fetch in sha fef7ee7
cookies are no longer sent.

This commit configures fetch in the webui to send cookies to the same
domain.

> The "same-origin" value makes fetch behave similarly to
> XMLHttpRequest with regards to cookies.
> https://github.com/github/fetch#sending-cookies
  • Loading branch information
Håkan Canberger committed Jun 11, 2018
1 parent b13eeab commit 98ac855
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/webui/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class API {

return fetch(url, {
method,
credentials: 'same-origin',
...options
}).then(handleErrors);
}
Expand Down

0 comments on commit 98ac855

Please sign in to comment.