[config] Lowercase the FQDN we get from the OS (closes #5040345)
Browsers convert the host name part of URLs to lowercase. This has the
unfortunate effect of triggering various CORS error messages in
CubicWeb (because the Origin: header will contain lowercase letters).
As per RFC 4343, host name comparison should be case-insensitive. So
let's put it in lowercase when we grab it from the host system. If
admins put uppercase letters in "host" or "base-url" in their
all-in-one.conf, then it's their fault.
--- a/etwist/twconfig.py Tue Mar 10 11:52:04 2015 +0100
+++ b/etwist/twconfig.py Wed Mar 11 15:17:25 2015 +0100
@@ -103,7 +103,7 @@
def default_base_url(self):
from socket import getfqdn
- return 'http://%s:%s/' % (self['host'] or getfqdn(), self['port'] or 8080)
+ return 'http://%s:%s/' % (self['host'] or getfqdn().lower(), self['port'] or 8080)
try: