Merge pull request #2263 from jicho/master

No redirect when url ends with #
This commit is contained in:
mdipierro authored and GitHub committed 2019-10-20 21:38:36 -07:00
commit 78b529bb92
1 file changed
+5 -1
+5 -1
View File
@@ -283,7 +283,11 @@
doc.ajaxSuccess(function (e, xhr) { doc.ajaxSuccess(function (e, xhr) {
var redirect = xhr.getResponseHeader('web2py-redirect-location'); var redirect = xhr.getResponseHeader('web2py-redirect-location');
if (redirect !== null) { if (redirect !== null) {
window.location = redirect; if (!redirect.endsWith('#')) {
window.location.href = redirect;
} else {
window.location.reload();
}
} }
/* run this here only if this Ajax request is NOT for a web2py component. */ /* run this here only if this Ajax request is NOT for a web2py component. */
if (xhr.getResponseHeader('web2py-component-content') === null) { if (xhr.getResponseHeader('web2py-component-content') === null) {