Intermediate
Block the Quiet Leak
The reply below contains four image addresses. Write imageAllowed(url) so it returns true only when the address uses https:, has no user name or password, and the host is exactly chai.example or cdn.chai.example.
The page lists each address in #images with the word allowed or blocked in a <li>. Do not change the list code.
What Check tests
- The own CDN image is allowed
- The outside address is blocked
- The user-info trick is blocked
- The look-alike host is blocked
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.