Some test changes to allow echoing requests at arbitrary locations in urlmap. You can now use ECHO [HTTPHeader] to display all headers (if HTTPHeader is not specified) or that header value as it came in the request. See <your-testserver>/echo for an example. Not in build (a=leaf)

git-svn-id: svn://10.0.0.236/trunk@65513 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gagan%netscape.com
2000-04-07 23:14:52 +00:00
parent 9b3878bbe5
commit 7b7e7d922a
6 changed files with 88 additions and 4 deletions

View File

@@ -123,6 +123,28 @@ class ScriptFile {
}
}
}
else if (s.startsWith("ECHO")) {
outDirty = true;
boolean parameter = false;
try {
String header = new String(s.substring(5));
String req= new String(con.request);
int t = req.indexOf(header);
if (t != -1) {
out.println(req.substring(
t, req.indexOf("\n", t)));
parameter = true;
}
else {
out.println("Error: " + header +
" not specified in request!");
}
}
catch (StringIndexOutOfBoundsException e) {}
if (!parameter)
out.println(con.request);
}
else if (s.startsWith("INCLUDE")) {
outDirty = true;
WriteOutFile("docs/" + s.substring(8));