diff --git a/static/js/features/library/photos.js b/static/js/features/library/photos.js index c2fe63ea..f8e4fa03 100755 --- a/static/js/features/library/photos.js +++ b/static/js/features/library/photos.js @@ -282,12 +282,13 @@ const photosView = { // Upload to server for permanent caching const token = localStorage.getItem('token') || sessionStorage.getItem('token'); - const headers = { 'Content-Type': blob.type }; + const headers = { 'Content-Type': blob.type, ...getCsrfHeaders() }; if (token) headers['Authorization'] = `Bearer ${token}`; fetch(`/api/files/${fileId}/thumbnail/preview`, { method: 'PUT', headers, + credentials: 'same-origin', body: blob, }).then((resp) => { if (resp.ok) {