diff --git a/lib/Uris.hs b/lib/Uris.hs
index 40ea43e3eb047454f47232009007055bb244ab22..127b7f197d34df72ddebdc2da3d6c79680a36480 100644
--- a/lib/Uris.hs
+++ b/lib/Uris.hs
@@ -42,7 +42,7 @@ type SchemaSet = Map Text [Substitution]
 -- and a normalised version of the same URI
 parseUri :: Text -> Maybe (Text, Text, Text, Text)
 parseUri raw =
-  case parseURI (toString raw) of
+  case parseURI (toString (T.strip raw)) of
     Nothing -> Nothing
     Just uri@URI{..} -> case uriAuthority of
         Nothing -> Nothing