|
14 | 14 | ['api/', 302, '', 'id="about"'], |
15 | 15 | ['beta/', 200, '', ''], |
16 | 16 | ['nightly/', 200, '', 'id="nightly"'], |
| 17 | + ['nightly/?date=20261001', 200, '', 'id="nightly"'], // Past date: always goes through the waiting page on a cold cache |
17 | 18 | ['calendar/', 200, '', 'id="calendar_main"'], |
18 | 19 | ['calendar/monthly/', 200, '', 'id="calendar_monthly"'], |
19 | 20 | ['release/', 200, 'Release Owner', 'id="release_'], // could be release_beta or release_current after beta 1 |
|
67 | 68 | [$path, $http_code, $content, $content2] = $paths[$i]; |
68 | 69 |
|
69 | 70 | $raw = curl_multi_getcontent($ch); |
| 71 | + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); |
| 72 | + |
| 73 | + // Pages preparing data display a waiting page that reloads itself once the |
| 74 | + // data is ready, do what a browser does and request the page again. |
| 75 | + for ($try = 0; $try < 3 && str_contains($raw, 'class="waitingpage"') && str_contains($raw, 'http-equiv="refresh"'); $try++) { |
| 76 | + $retry = curl_init('http://localhost:8083/' . $path); |
| 77 | + curl_setopt_array($retry, [ |
| 78 | + CURLOPT_RETURNTRANSFER => true, |
| 79 | + CURLOPT_FOLLOWLOCATION => true, |
| 80 | + CURLOPT_HEADER => true, |
| 81 | + ]); |
| 82 | + $raw = (string) curl_exec($retry); |
| 83 | + $header_size = curl_getinfo($retry, CURLINFO_HEADER_SIZE); |
| 84 | + curl_close($retry); |
| 85 | + } |
| 86 | + |
70 | 87 | preg_match('/HTTP\/\d[\d.]* (\d+)/', $raw, $matches); |
71 | 88 | $first_code = isset($matches[1]) ? (int) $matches[1] : 0; |
72 | | - $body = substr($raw, curl_getinfo($ch, CURLINFO_HEADER_SIZE)); |
| 89 | + $body = substr($raw, $header_size); |
73 | 90 |
|
74 | 91 | echo "\e[1;32m✓\e[0m " . ($path ?: '(empty string)') . "\n"; |
75 | 92 | $obj->setPath($path); |
|
0 commit comments