1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-08-07 16:02:55 +03:00

HTTP POST requests to static files must return 405

Fix for a bug recently introduced in a redesign of the request handling.
Fix for a request method test page.
This commit is contained in:
bel
2015-01-04 00:12:12 +01:00
parent 971310a422
commit 4040ba73f9
2 changed files with 14 additions and 7 deletions

View File

@@ -25,10 +25,14 @@
function load() {
var params = getParams();
method = params["method"];
var method = params["method"];
if (!method) {
method = "GET";
}
var path = params["path"];
if (!path) {
path = "";
}
var elem = document.getElementById('h1');
elem.innerHTML = "HTTP method test page";
@@ -36,7 +40,7 @@
document.getElementById("proto_http").checked = (window.location.protocol != "https:");
document.getElementById("proto_https").checked = (window.location.protocol == "https:");
document.getElementById("server").value = location.host;
document.getElementById("resource").value = "path";
document.getElementById("resource").value = path;
document.getElementById("method_get").checked = true;
document.getElementById("body_none").checked = true;
@@ -82,7 +86,10 @@
{
var laddr = addr
var lmeth = meth
var blen = "\nWith " + body.length + " bytes body data"
var blen = ""
if (body) {
blen = "\nWith " + body.length + " bytes body data"
}
if (xmlhttp.readyState == 4)
{
@@ -133,8 +140,8 @@ TODO: Description how to use this page.
<input id="method_inv" type="radio" name="method" value="INVALID" />*INVALID*
<h3>Body data</h3>
<input id="body_none" type="radio" name="body" value="*" />*none* <br />
<input id="body_10" type="radio" name="body" value="1234567890" />1234567890 <br />
<input id="body_none" type="radio" name="body" value="*" />0 Bytes <br />
<input id="body_10" type="radio" name="body" value="1234567890" />10 Bytes ("1234567890") <br />
<h3>Submit</h3>