Comments (5)
/me waves from afar
from email-validate-hs.
The reason for this is that the email-address RFC (5322, section 3.4.1) specifies a really loose definition for domain names, so things that the email-address RFC says are valid might not really be a valid domain.
To fix this I've added a parser for domain names that is run on the result of the domain-name parse to ensure that it really is valid by the domain name RFC(s). (Note that this is not yet in a shipped version—since the change is not technically backwards-compatible & I haven't quite decided what to do with it yet...)
The reason it's not simply using the domain name parser instead is that the email-address parser performs some canonicalization as a "side-effect" of parsing—it strips out comments and something called 'folding whitespace' (collectively 'CFWS'). These are valid in the input email address but not in the resulting domain name.
Specifically, if one wanted to re-write the whole domainName parser to not use an inner parse, would that be possible in some way while giving correct results?
It would be possible to fold in the domain name parsing with the email-address version to come up with a parser that handles the CFWS, but I haven't done this yet as it was easier to show that the domain-name handling is correct when done in this manner.
To remedy this I should really just write the combined version, add some quickcheck properties to check that it does the same thing as the two-stage parse, then delete the old one
from email-validate-hs.
I think I'll have some time tonight to look at this.
from email-validate-hs.
Made the change, want to add a few more tests & I'll push it tomorrow.
from email-validate-hs.
Finally pushed this...
from email-validate-hs.
Related Issues (20)
- Create a joint test suite with hsemail HOT 2
- quasiquoter? HOT 3
- Cabal homepage URL is returning a 404 HOT 2
- Consider adding PathPiece instance? HOT 3
- Major version changes (v3) HOT 4
- Add NFData and Binary instances to EmailAddress HOT 2
- Allow testing with doctest-0.15 HOT 4
- Allow testing with hspec-2.5 HOT 1
- Use case-insensitive ByteString in EmailAddress HOT 2
- Quotes-wrapped `Show` intentional? HOT 3
- Zero width characters
- Status of v3 and offer of help HOT 1
- Please relax version constraint on 'template-haskell' to support ghc-8.10.1 HOT 2
- Fail on dotless domain names
- testsuite failing in Stackage Nightly HOT 4
- The package is disabled in Stackage HOT 4
- Create EmailAdress or validate String HOT 1
- canonicalizeEmail removes spaces inside emails HOT 3
- hspec-2.11 not accepted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from email-validate-hs.