(response: Response)
| 48 | |
| 49 | // Reads don't fail on a stale client, they just say so in a header. |
| 50 | export const checkResponseForOutdatedClient = (response: Response): boolean => { |
| 51 | const minimum = readHeader(response, CLIENT_OUTDATED_HEADER) |
| 52 | if (!minimum) { |
| 53 | return false |
| 54 | } |
| 55 | |
| 56 | console.warn(`api: The server reports this client (${config.appVersion}) is below its minimum of ${minimum}.`) |
| 57 | announceClientOutdated(minimum) |
| 58 | return true |
| 59 | } |
| 60 | |
| 61 | // 426 is the gate's status, but match on the body code as well so a proxy rewriting the status |
| 62 | // can't turn a required reload into an unexplained failure. |
no test coverage detected