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

[feature] implement wildcard subdomains for APIs' public_dns #381

Merged
merged 3 commits into from
Jul 9, 2015

Conversation

thibaultcha
Copy link
Member

An API's public_dns can now contain one '*' at the start or at the end of the string, and on a dot border (same rules as http://nginx.org/en/docs/http/server_names.html#wildcard_names).

If so, it will get special treatment during the lookup and the resolver will try to match any given Host header against all wildcard public_dns.

We keep things efficient by guaranteeing O(1) lookup for non wildcard public_dns. Only wildcard public_dns and paths will be O(n).

Implements #297.

-- If the API was not found in the dictionary, maybe it is a wildcard public_dns.
-- In that case, we need to loop over all of them.
for _, wildcard_dns in ipairs(apis_dics.wildcard_dns) do
print("--------------------------------------------------------")
Copy link
Member Author

Choose a reason for hiding this comment

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

Oops

An API's `public_dns` can now contain one '*' at the start or at the end
of the string, and on a dot border (same rules as
http://nginx.org/en/docs/http/server_names.html#wildcard_names).

If so, it will get special treatment during the lookup and the resolver
will try to match any given `Host` header against all wildcard
public_dns.

We keep things efficient by guaranteeing O(1) lookup for non wildcard
public_dns. Only wildcard public_dns and paths will be O(n).

Implements #297.
@vmattos
Copy link

vmattos commented Jul 6, 2015

👍

@thibaultcha thibaultcha added pr/ready (but hold merge) No more concerns, but do not merge yet (probably a conflict of interest with another PR or release) and removed NEEDS REVIEW labels Jul 9, 2015
thibaultcha added a commit that referenced this pull request Jul 9, 2015
[feature] implement wildcard subdomains for APIs' public_dns
@thibaultcha thibaultcha merged commit a01fbfa into master Jul 9, 2015
@thibaultcha thibaultcha deleted the feature/wildcard-subdomains branch July 9, 2015 23:08
ctranxuan pushed a commit to streamdataio/kong that referenced this pull request Aug 25, 2015
[feature] implement wildcard subdomains for APIs' public_dns

Former-commit-id: a66441044105d0a70ede72c708dc381efa370da1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/ready (but hold merge) No more concerns, but do not merge yet (probably a conflict of interest with another PR or release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants