Skip to content

Commit fab898e

Browse files
authored
Merge pull request #372 from Gounlaf/feature/wildcarddns
Support another "wildcard dns provider": nip.io
2 parents ac06650 + 1e7b020 commit fab898e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ function show_valet_404()
2020
/**
2121
* @param $domain string Domain to filter
2222
*
23-
* @return string Filtered domain (without xip.io feature)
23+
* @return string Filtered domain (without wildcard dns feature (xip.io/nip.io))
2424
*/
25-
function valet_support_xip_io($domain)
25+
function valet_support_wildcard_dns($domain)
2626
{
27-
if (substr($domain, -7) === '.xip.io') {
27+
if (in_array(substr($domain, -7), ['.xip.io', '.nip.io'])) {
2828
// support only ip v4 for now
2929
$domainPart = explode('.', $domain);
3030
if (count($domainPart) > 6) {
@@ -50,8 +50,8 @@ function valet_support_xip_io($domain)
5050
);
5151

5252
$siteName = basename(
53-
// Filter host to support xip.io feature
54-
valet_support_xip_io($_SERVER['HTTP_HOST']),
53+
// Filter host to support wildcard dns feature
54+
valet_support_wildcard_dns($_SERVER['HTTP_HOST']),
5555
'.'.$valetConfig['domain']
5656
);
5757

0 commit comments

Comments
 (0)