Skip to content

Commit

Permalink
Send credentials with on-demand-entries-ping (#5053)
Browse files Browse the repository at this point in the history
In my use case, the client pings are failing since the requests do not send basic auth credentials right now.

This change was made in #2509

I am not sure why it was undone as a part of #3578

Can someone explain why? Thanks.
  • Loading branch information
itsfadnis authored and timneutkens committed Aug 29, 2018
1 parent 99c509e commit 48e4c77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/on-demand-entries-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export default ({assetPrefix}) => {
try {
const url = `${assetPrefix || ''}/_next/on-demand-entries-ping?page=${Router.pathname}`
const res = await fetch(url, {
credentials: 'omit'
credentials: 'same-origin'
})
const payload = await res.json()
if (payload.invalid) {
// Payload can be invalid even if the page is not exists.
// So, we need to make sure it's exists before reloading.
const pageRes = await fetch(location.href, {
credentials: 'omit'
credentials: 'same-origin'
})
if (pageRes.status === 200) {
location.reload()
Expand Down

0 comments on commit 48e4c77

Please sign in to comment.