[[ 🏗
=br6Go Vervis
]] ::
[📥 Inbox]
[📤 Outbox]
[🐤 Followers]
[🤝 Collaborators]
[🐛 Tickets]
[📖 Wiki]
[✏ Edit]
Network.FedURI: `Authority` constructor allows creating invalid values
Created on 2019-07-21 by
~fr33domlover
Since the Authority
data constructor is entirely exported, it’s possible to create Authority
values that:
- Use port 80 or 443
- Specify any
Text
value as the host - Use
localhost
without a port number (implying HTTPS) or an internet domain name with a port number (implying HTTP)
Ideas:
- Hide the
Authority
constructor, and instead export 2 functions, one forDev
and one forFed
. But check where in the code theAuthority
constructor is really used! Why do these values get constructed manually? - Split
Authority
into 2 separate types (instead of 1 type with the 3 possible tags, Full/Fed/Dev) with separate constructors - Hide the
Authority
contructor, and instead provide some smart functions that are members of theUriMode
class
Status: Open