From 98ac855e0f7bb0f64fea240b2ac0afdf4317c53d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akan=20Canberger?= Date: Mon, 11 Jun 2018 12:50:53 +0200 Subject: [PATCH] fix: configure fetch to send cookies Previously, when XMLHttpRequest was used, cookies ware sent when getting /-/verdaccio/logo & /-/verdaccio/packages After switching to fetch in sha fef7ee75e8a02dc3a6017b70dcb62dabf9183e0f 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 --- src/webui/utils/api.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/webui/utils/api.js b/src/webui/utils/api.js index 084738dfd..c76ffe3e2 100644 --- a/src/webui/utils/api.js +++ b/src/webui/utils/api.js @@ -26,6 +26,7 @@ class API { return fetch(url, { method, + credentials: 'same-origin', ...options }).then(handleErrors); }