I am facing a pen testing issue as below. Is there a way so that we can restrict the method as POST from the java-script end. Tried .setAttribute('method', 'POST') but that is breaking the application. Is there any other way to achieve this so that the pen testing issue can be resolved? I am using a stripes form and button as in the snippet below.
Request designed as POST is accepted as GET . The application will accept and process a request sent as a GET, even though it is designed to be used as a POST. A GET request exposes any included parameters in browser history, printed pages, and server logs. A POST prevents those exposures.
<stripes:form autocomplete="off" beanclass="com.demo.SubmitEmployeeAction" id="submitEmployeeForm" name="submitEmployeeForm">
$("#submitEmp").click(function(event){
event.preventDefault();
document.submitEmployeeForm.action='SubmitEmployee.action?submitEmployeeForm=';
$("#submitEmp").attr('disabled','disabled');
$("#submitEmployeeForm").submit();
});
<button id="submitEmp" class="grayBtnCancel" style="font-size: 93%;" >Submit Employee</button>