# HG changeset patch # User RĂ©mi Cardona # Date 1426083445 -3600 # Node ID 996cf2c0ec9906b54067d33eb2978476b57605ea # Parent fbb3701951997a432febd734eaa3c051a8387460 [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. diff -r fbb370195199 -r 996cf2c0ec99 etwist/twconfig.py --- 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: