-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
bug #64441 fixed #328
bug #64441 fixed #328
Conversation
Do you have reference RFC that states this to be valid? An FQDN is not mandated to end with a dot in any URL specifications I can find, and neither does it appear to be legal - the only place that does allow this syntax that I am aware of is the DNS zone files as specified in RFC1035. I could be wrong, but I suspect that it is |
Yes, it's caused by FQDN. In RFC 1738 "host" is "The fully qualified domain name of a network host". |
Updated RFC2396 still the same. RFC3986 supports the same strategy. |
After re-reading the relevant RFCs I now agree that this is probably correct behaviour, although it does look a little odd, but since the final empty label refers to the "root domain" this is probably technically valid. It certainly makes sense in terms of how the DNS resolver works. I will try compiling this later and see if I can break your fix :-P (although at first glance it looks sensible). However, you should definitely add a test to the PR. |
Yes, please don’t merge without a test. |
I'm new on this project and I'm glad to get your responses. |
This passes http://a./ as a correct URL. I don't think it is. |
Reading RFC, I think I was wrong, trailing dot is valid. But some servers can't handle it properly as it seems: http://stackoverflow.com/questions/3314192/how-do-i-allow-trailing-dot-in-host-headers-in-iis/3483411#3483411 |
@smalyshev We should be server agnostic right? If a particular server has a bug that means it does not conform to the RFC, then the maintainers of that server should fix it. My personal opinion is that we should allow the trailing dot as a valid hostname, as it is valid per the RFC. Unrelated but interesting side note, Firefox will complain about hosts with a trailing dot over SSL, because the certificate does not match the hostname. Chrome is happy to accept the host with a trailing dot when the certificate does not match the hostname. It seems "issues" related to this trailing dot are widespread. Again I think we should comply with the RFC |
I agree we should comply with the RFC, particularly as it's backed by popular DNS software like bind and browsers. I've queued it for 5.4.21 unless there are objections. |
Comment on behalf of mike at php.net: Already merged. |
For future reference commit SHA1 is 18b54a2 |
Checkout please
https://bugs.php.net/bug.php?id=64441