Skip to content

Commit e5f225b

Browse files
committed
Add logic to show redirects in full example.
1 parent 4433134 commit e5f225b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/example.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ function getHomepage() : string
162162
textarea {height: 10em; width: 100%;}
163163

164164
.empty { opacity: 0.1; background: lightgray; }
165+
.redirected::before {content: "(redirected to)";}
165166
.status-2 p {background: green}
166167
.status-4 p {background: orangered}
167168
.status-5 p {background: darkred}
@@ -202,7 +203,7 @@ function getHomepage() : string
202203
});
203204

204205
output.innerHTML += `
205-
<p>
206+
<p class="${response.redirected ? 'redirected' : ''}">
206207
<code>${response.status}</code> ${response.statusText}
207208
</p>
208209
<pre><code>${headers}</code></pre>

0 commit comments

Comments
 (0)