-
Notifications
You must be signed in to change notification settings - Fork 6.6k
debug: recreate change in 12544 #13000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| // Copyright Google Inc. | ||
| // | ||
| // Copyright 2017 Google LLC | ||
|
|
||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
|
|
||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
|
|
||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
|
|
@@ -54,10 +54,21 @@ function sessionRefreshClicked() { | |
|
|
||
| function checkSessionRefresh() { | ||
| if (iapSessionRefreshWindow != null && !iapSessionRefreshWindow.closed) { | ||
| fetch('/favicon.ico').then(function(response) { | ||
| // Attempting to start a new session. | ||
| // XMLHttpRequests is used by the server to identify AJAX requests | ||
| fetch('/favicon.ico', { | ||
| method: "GET", | ||
| credentials: 'include', | ||
| headers: { | ||
| 'X-Requested-With': 'XMLHttpRequest' | ||
| } | ||
|
Comment on lines
+57
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While the added headers are helpful, the code lacks clarity on why they are necessary for AJAX request identification. Explain the purpose of |
||
| }).then(function(response) { | ||
| // Checking if browser has a session for the requested app | ||
| if (response.status === 401) { | ||
| // No new session detected. Try to get a session again | ||
| window.setTimeout(checkSessionRefresh, 500); | ||
| } else { | ||
| // Session retrieved. | ||
| iapSessionRefreshWindow.close(); | ||
| iapSessionRefreshWindow = null; | ||
|
Comment on lines
67
to
73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comments |
||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's standard practice to omit the year in copyright notices unless the copyright has changed hands or there's a specific legal reason to include it. Consider simplifying to
// Copyright Google LLCto adhere to common conventions.