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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user