Skip to content
This repository has been archived by the owner on Sep 8, 2018. It is now read-only.

hostserv: add ability to set valid/invalid vHost patterns for requests #5

Open
Renegade334 opened this issue Jan 3, 2015 · 4 comments

Comments

@Renegade334
Copy link
Contributor

Currently, there is only a rudimentary check on vHost requests through HostServ (check_vhost_validity) to check if they are fundamentally valid strings. However, many networks will implement their own vHost policy, such as no capitals, no valid TLDs, or whatever else.

There could be added functionality for customising what HostServ will consider a valid or invalid vHost. It could be implemented similar to NickServ's BADMAIL function, with simple globmask matching of invalid strings. It would probably be better suited to regex matching, which would provide more control over patterns.

@maxteufel
Copy link
Contributor

Good idea, but marking as needs-discussion because a network could also write a custom protocol module with a custom check_vhost_validity function.

@Renegade334
Copy link
Contributor Author

A candidate for providing the ability to overwrite check_vhost_validity: Renegade334/atheme@ed4e16c1d9ba289f880d72c1977462e777e71be4. A quick proof-of-concept is at https://gist.github.com/Renegade334/fba75c07fc79eccb1b4c.

@kaniini
Copy link
Contributor

kaniini commented Mar 16, 2015

Seems kinda ugly and hackish that way, no?

@Renegade334
Copy link
Contributor Author

Well, it's similar in implementation to protocol-related validation functions such as is_valid_host. Hackish, yes, but I wouldn't call it ugly! ;-)

It's a point of philosophical debate whether or not check_vhost_validity should be overwritable for such purposes, but if it is, then can you think of a simpler way?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants