wildcard support? #9

Closed
by Ghost opened 6 years ago · 5 comments
Ghost commented 6 years ago

I was getting invalid domain name error when doing *.example.com

I changed utils.js
from
var re = /^[a-zA-Z0-9.-]+$/;
to
var re = /^(*.)?[a-zA-Z0-9.-]+$/;

and the it worked :)

Let me know if I'm just completely missing something here though.

to support wildcards.

I was getting invalid domain name error when doing *.example.com I changed utils.js from var re = /^[a-zA-Z0-9\.\-]+$/; to var re = /^(\*\.)?[a-zA-Z0-9\.\-]+$/; and the it worked :) Let me know if I'm just completely missing something here though. to support wildcards.
Owner

Ah...

Good catch. I updated the underlying acme-v2.js, and had tested that, but I hadn't actually tested it in greenlock itself.

Thanks so much for the patch!

I really, really appreciate it.

I'll try to fit it in to get that published within a few hours.

:)

Ah... Good catch. I updated the underlying acme-v2.js, and had tested that, but I hadn't actually tested it in greenlock itself. Thanks so much for the patch! I really, really appreciate it. I'll try to fit it in to get that published within a few hours. :)

sweet :)

sweet :)
Owner

Hey m00ki3, Will you test v2.2.7?

This is the change that I made:

var re = /^(\*\.)?[a-zA-Z0-9\.\-]+$/;
> var re = /^(\*\.)?[a-zA-Z0-9\.\-]+$/;
undefined
> re.test('*.example.com')
true
> re.test('example.com')
true
> re.test('example.com.*')
false
> re.test('foobar!')
false
Hey `m00ki3`, Will you test v2.2.7? This is the change that I made: ```js var re = /^(\*\.)?[a-zA-Z0-9\.\-]+$/; ``` ``` > var re = /^(\*\.)?[a-zA-Z0-9\.\-]+$/; undefined > re.test('*.example.com') true > re.test('example.com') true > re.test('example.com.*') false > re.test('foobar!') false ```
Owner

At first I read your regex incorrectly because the \ were taken out... but makes sense now. :)

At first I read your regex incorrectly because the `\` were taken out... but makes sense now. :)

woo hoo! yup, works :)

woo hoo! yup, works :)
coolaj86 closed this issue 6 years ago
coolaj86 referenced this issue from a commit 5 years ago
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.