Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow hostnames with underscores when parsing URLs #324

Merged
merged 2 commits into from
Nov 24, 2020
Merged

Allow hostnames with underscores when parsing URLs #324

merged 2 commits into from
Nov 24, 2020

Conversation

sebthom
Copy link
Contributor

@sebthom sebthom commented Nov 22, 2020

Description:

Related issue (if applicable): #323

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Copy link
Owner

@caronc caronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First off; thank you so much for taking the initiative to do a merge. That's really awesome of you 👍

Can you also have a peak at the GET_EMAIL_RE in the utils.py as well? It looks like this:

GET_EMAIL_RE = re.compile(
    r'((?P<name>[^:<]+)?[:<\s]+)?'
    r'(?P<full_email>((?P<label>[^+]+)\+)?'
    r'(?P<email>(?P<userid>[a-z0-9$%=_~-]+'
    r'(?:\.[a-z0-9$%+=_~-]+)'
    r'*)@(?P<domain>('
    r'(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+'
    r'[a-z0-9](?:[a-z0-9-]*[a-z0-9]))|'
    r'[a-z0-9][a-z0-9-]{5,})))'
    r'\s*>?', re.IGNORECASE)

I guess it should probably change to:

GET_EMAIL_RE = re.compile(
    r'((?P<name>[^:<]+)?[:<\s]+)?'
    r'(?P<full_email>((?P<label>[^+]+)\+)?'
    r'(?P<email>(?P<userid>[a-z0-9$%=_~-]+'
    r'(?:\.[a-z0-9$%+=_~-]+)'
    r'*)@(?P<domain>('
    r'(?:[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?\.)+'
    r'[a-z0-9](?:[a-z0-9_-]*[a-z0-9]))|'
    r'[a-z0-9][a-z0-9_-]{5,})))'
    r'\s*>?', re.IGNORECASE)

I think that's the only other spot...

@sebthom sebthom closed this Nov 22, 2020
@sebthom sebthom reopened this Nov 22, 2020
@codecov-io
Copy link

codecov-io commented Nov 22, 2020

Codecov Report

Merging #324 (d047d85) into master (2c2722f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #324   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           85        85           
  Lines        10626     10626           
  Branches      1772      1772           
=========================================
  Hits         10626     10626           
Impacted Files Coverage Δ
apprise/utils.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c2722f...d047d85. Read the comment docs.

Copy link
Owner

@caronc caronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding testing! That's much appreciated! Just 2 small changes is all I'd ask, otherwise it looks great!

apprise/utils.py Outdated Show resolved Hide resolved
apprise/utils.py Outdated Show resolved Hide resolved
@caronc
Copy link
Owner

caronc commented Nov 24, 2020

Great work; thank you very much for the PR! 🎉 👍

@caronc caronc merged commit fa05cfa into caronc:master Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants