bugger.
All challenges/Pythonmediumthe-hostname-that-changes-shape-v1
THE INVESTIGATION

The hostname that changes shape

An authority string passes a delimiter check, then Unicode normalization changes its structure.

UnicodeParsingSecurity

What’s going wrong

A URL authority guard checks text before another layer applies Unicode NFKC normalization. It currently accepts some authorities whose normalized form introduces URL delimiters.

Input is an array of authority strings, without scheme, path, query or fragment. Print one boolean per string. Empty strings and raw /, ? or # are rejected. Existing ASCII @ and : are permitted for credentials and ports. Reject any additional /, ?, #, @ or : introduced by NFKC normalization of the remaining text. Other Unicode characters, including those with harmless normalization changes, remain permitted. This is a structural guard, not a complete hostname validator.

Expected behavior

Reject normalization that creates delimiters while retaining ordinary credentials, ports and harmless Unicode authorities.

Reproduction

01 Wide slash changes structure
["example.com/extra"]
[false]
02 Credentials and port
["user:pw@example.com:443","example.com"]
[true,true]
03 Harmless Unicode change
["K.example","example.com"]
[true,true]

Before you begin

  • Unicode normalization
  • Strings
  • Validation boundaries

Need a nudge?

Reveal one investigation hint at a time. Try each clue before opening the next.

    The bug is intentional. Run the starter code to see it fail, then work toward a fix. Difficulty is provisional.
    Read-only preview
    Ready when you are
    Every fix starts with a failing test.

    Read the report, then sign in to start your investigation.