Skip to content

fix: wildcard pattern matching#7265

Merged
jackkav merged 1 commit intoKong:developfrom
hvitoi:fix-wildcard-pattern-match
Apr 19, 2024
Merged

fix: wildcard pattern matching#7265
jackkav merged 1 commit intoKong:developfrom
hvitoi:fix-wildcard-pattern-match

Conversation

@hvitoi
Copy link
Contributor

@hvitoi hvitoi commented Apr 12, 2024

Closes #7181

Rationale

The new URL keyword was previously instantiating an unknown class which does encode the hostname characters so that https://*.myhost.com/ was turned into https://%2A.myhost.com and the latter would not match with the actual url being requested and thus the certificate would not be attached to the request itself.

This fix forces the use of the node:url module which does return a more predictable output (and not encoding the star symbol).

It's not clear why this bug is not caught by the test suite since this exact test case is already validated. If you have any suggestion we could explore other test scenarios.

@CLAassistant
Copy link

CLAassistant commented Apr 12, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@subnetmarco
Copy link
Member

Thanks for the contribution. @filfreire can you review it?

@hvitoi
Copy link
Contributor Author

hvitoi commented Apr 17, 2024

What are the next steps on this? @filfreire Is there any action left?

@filfreire
Copy link
Contributor

@jackkav @gatzjames @CurryYangxx if possible please give a second pass to this

@jackkav
Copy link
Contributor

jackkav commented Apr 19, 2024

Nice catch, can confirm. I suspect the tests pass because they run in a node context so web apis are polyfilled with node ones.

image image

@jackkav jackkav merged commit fb38d98 into Kong:develop Apr 19, 2024
@hvitoi hvitoi deleted the fix-wildcard-pattern-match branch April 19, 2024 20:56
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.

Regression: wildcard values don't work for the host of certificates

5 participants