From 7fa63cec81301003293723929586b6ff20262f26 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Mon, 12 Sep 2016 21:37:00 +0200 Subject: [PATCH] - Improved the 'ajax form' it now uses the form method to create the ajax call (thanks to Felipe De Boni for suggesting this fix) --- .../src/main/webapp/js/goatApp/view/LessonContentView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webgoat-container/src/main/webapp/js/goatApp/view/LessonContentView.js b/webgoat-container/src/main/webapp/js/goatApp/view/LessonContentView.js index c6a997b9c..f0ec27a03 100644 --- a/webgoat-container/src/main/webapp/js/goatApp/view/LessonContentView.js +++ b/webgoat-container/src/main/webapp/js/goatApp/view/LessonContentView.js @@ -24,15 +24,16 @@ define(['jquery', //TODO: reimplement this in custom fashion maybe? makeFormsAjax: function () { + var $form = $('form'); var options = { success:this.reLoadView.bind(this), url: this.model.urlRoot, - type:'POST' + type: $form.attr('method') // $.ajax options can be used here too, for example: //timeout: 3000 }; //hook forms //TODO: clarify form selectors later - $("form").ajaxForm(options); + $form.ajaxForm(options); }, ajaxifyAttackHref: function() { // rewrite any links with hrefs point to relative attack URLs