apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

bug: Host matching cannot carry ports

Open DokiDoki1103 opened this issue 1 year ago • 4 comments

Current Behavior

The ApisixRoute "rbd-http-routes" is invalid: spec.http.match.hosts: Invalid value: "8.130.141.31:7070": spec.http.match.hosts in body should match '^*?[0-9a-zA-Z-._]+$'

/^\*?[0-9a-zA-Z-._]+$/.test('8.130.141.31:7070')
false 
/^\*?[0-9a-zA-Z-._]+$/.test('8.130.141.31') 
true

Some users access their applications through IP and ports, and use the HTTP protocol, so they hope to increase support for the HTTP port

DokiDoki1103 avatar Nov 22 '23 03:11 DokiDoki1103

cc @Revolyssup

DokiDoki1103 avatar Nov 22 '23 03:11 DokiDoki1103

@DokiDoki1103 Thanks for catching this. The regex that APISIX accepts for this field doesn't match with the one accepted by ingress controller. I will create a fix for this. https://github.com/apache/apisix/blob/a2da5f156c433b373ba670ce9eecdfdcb4cf7268/apisix/schema_def.lua#L40C23-L40C51

Revolyssup avatar Nov 22 '23 07:11 Revolyssup

@Revolyssup You're welcome, I'm using Apisix extensively. If I encounter any problems, I'll give you feedback promptly

DokiDoki1103 avatar Nov 30 '23 03:11 DokiDoki1103

This issue has been marked as stale due to 90 days of inactivity. It will be closed in 30 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Feb 29 '24 01:02 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Mar 31 '24 01:03 github-actions[bot]