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

Already on GitHub? Sign in to your account

Added strict subdomain check, domain option and tests. #2

Merged
merged 3 commits into from Mar 10, 2013

Conversation

Projects
None yet
3 participants
Contributor

gabmontes commented Mar 5, 2013

Including the following enhancements and fixes:

  • Added conditions to the regex to ensure the base string matches only at the beginning of the requested url and before any .. This prevents the subdomain string matching any part of the url, i.e. in the middle. Tests added.
  • Added an option to set a domain, so you can check for the full url (base + domain) and not only the subdomain. This is fully optional. Tests added.
  • Removed the parameters on the call to next in the middleware function. That was breaking Express. Tests updated.
  • Minor linting changes.

Thanks for sharing this module!!!

Owner

tblobaum commented Mar 5, 2013

Thanks! With the added domain config, do you think this should this be able to handle multiple domains instead of just one?

tblobaum added a commit that referenced this pull request Mar 10, 2013

Merge pull request #2 from gabmontes/strictcheck
Added strict subdomain check, domain option and tests.

@tblobaum tblobaum merged commit 2734263 into tblobaum:master Mar 10, 2013

1 check passed

default The Travis build passed
Details
Contributor

gabmontes commented Mar 15, 2013

@tblobaum The module as it is today is able to manage only one domain.

In order to manage multiple domains, the usage scenario should be defined first: multiple domains with the same subdomain configuration vs. multiple domains with different subdomain configuration.

You may add an specific issue on the topic for further discussion and development.

@gabmontes gabmontes deleted the gabmontes:strictcheck branch Mar 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment