question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Capital letters in domains are invalid

See original GitHub issue

https://jsfiddle.net/rfdsvh0m/

Not much extra information I can give for this one, title and jsfiddle cover technical.

email@domain.com: Valid email@Domain.com: Invalid

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
malinushjcommented, Jul 23, 2021

For those looking for an intermediary fix, here’s my solution using a helper function:

// force the domain of the email to be lowercase and send it to the email validator
export const emailFormatter = (value) => {
  if (!value) return value;
  let parts = value.split('@');
  if (parts.length !== 2) return value;
  parts[1] = parts[1].toLowerCase();
  return parts.join('@');
}

This is how it would be used:

import { email, required } from 'vuelidate/lib/validators';
import { emailFormatter } from ...

// ...
validations: {
    form: {
      email: {
        required,
        email: (val) => email(emailFormatter(val)),
      },
    },
  },
// ...
2reactions
aethrcommented, Nov 19, 2020

@dobromir-hristov in that case I think we should fix the email validator to be case-insensitive for domains.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are Domains & URLs Case Sensitive? (9 Important Facts)
Domain names are not case sensitive, but there are times when URLs are. This means you can enter a website's URL in all...
Read more >
Are Domain Names and URLs Still Case In-Sensitive in 2022?
Should domain names be capitalized? ... Whatever comes after the com is case sensitive, that's why we will recommend that at the time...
Read more >
Can You Use Capital Letters in URL? - Sitechecker
Although not entirely bad, one of the major drawbacks of capital letters in URLs is they could result in multiple pages with the...
Read more >
Why don't URLs support capital letters? - Quora
Whether the URLs should be all lowercase, or not… the domain name can be stated in all upper case, only the first word...
Read more >
Valid And Invalid Domain Name Characters (-,@,&,.,_)
Most of the special characters except hyphens are not allowed in a (second level) domain. Things like an underscore, period, comma, apostrophe, exclamation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found