Skip to content

Commit

Permalink
Add 'Sec-Fetch-Mode navigate' header to HTTP requests when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
rentallect committed Jan 21, 2025
1 parent b52b3cb commit 49fe0d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ZitiFirstStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,11 @@ class ZitiFirstStrategy extends CacheFirst /* NetworkFirst */ {
newHeaders.append( 'Remote-User', await this._zitiContext.getAccessTokenEmail() );
} catch (e) {}

if (isEqual(request.mode,'navigate')) {
this.logger.trace(`Navigation event detected: [${request.url}]`);
newHeaders.append( 'Sec-Fetch-Mode', 'navigate' );
}

// Propagate any Cookie values we have accumulated
let cookieHeaderValue = '';
for (const cookie in this._zitiBrowzerServiceWorkerGlobalScope._cookieObject) {
Expand Down

0 comments on commit 49fe0d4

Please sign in to comment.