You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2014/07/02 10:26:40 UTC
git commit: WICKET-5631 Allow submitting with POST method for
PhantomJS
Repository: wicket
Updated Branches:
refs/heads/wicket-6.x b5ba97e7e -> 46591fb10
WICKET-5631 Allow submitting with POST method for PhantomJS
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/46591fb1
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/46591fb1
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/46591fb1
Branch: refs/heads/wicket-6.x
Commit: 46591fb109e94b53a24be868a6de96bfd6117d7a
Parents: b5ba97e
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Wed Jul 2 11:25:36 2014 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Wed Jul 2 11:25:36 2014 +0300
----------------------------------------------------------------------
testing/wicket-js-tests/Gruntfile.js | 12 ++++++++++++
.../org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 3 +--
2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/46591fb1/testing/wicket-js-tests/Gruntfile.js
----------------------------------------------------------------------
diff --git a/testing/wicket-js-tests/Gruntfile.js b/testing/wicket-js-tests/Gruntfile.js
index b05d30a..e3a39ee 100644
--- a/testing/wicket-js-tests/Gruntfile.js
+++ b/testing/wicket-js-tests/Gruntfile.js
@@ -122,6 +122,18 @@ module.exports = function(grunt) {
server: {
options: {
port: 38888,
+// debug: true,
+ middleware: function(connect, options, middlewares) {
+ middlewares.unshift(function(req, res, next) {
+ if (req.url.indexOf('submitNestedForm') > 0) {
+ // WICKET-5631
+ req.method = 'GET';
+ }
+ return next();
+ });
+
+ return middlewares;
+ },
base: '../../wicket-core/src'
}
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/46591fb1/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 9b638a2..7cbead6 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -873,8 +873,7 @@
form.action = form.action + '&' + dynamicExtraParameters;
}
}
- // PhantomJS cannot submit with POST to iframe
- form.method = /PhantomJS/.test(navigator.userAgent) ? 'get' : 'post';
+ form.method = 'post';
form.enctype = "multipart/form-data";
form.encoding = "multipart/form-data";