From: Jo-Philipp Wich Date: Mon, 13 Jun 2011 21:57:58 +0000 (+0000) Subject: themes/base: use location.host, fallback to location.hostname in xhr.js, fixes AJAX... X-Git-Tag: 0.11.0~2061 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=a0d62ab9bf0770649ac06ebfaee87e50d249e9af themes/base: use location.host, fallback to location.hostname in xhr.js, fixes AJAX with numeric IPv6 access --- diff --git a/themes/base/htdocs/luci-static/resources/xhr.js b/themes/base/htdocs/luci-static/resources/xhr.js index a146fa8a1..096a04484 100644 --- a/themes/base/htdocs/luci-static/resources/xhr.js +++ b/themes/base/htdocs/luci-static/resources/xhr.js @@ -43,7 +43,7 @@ XHR = function() var xhr = this._xmlHttp; var code = this._encode( data ); - url = location.protocol + '//' + location.hostname + + url = location.protocol + '//' + (location.host || location.hostname) + ( location.port ? ':' + location.port : '' ) + url; if( code )