Hello,
I have come across a strange bug which one of our customers who runs a
local Squid proxy cache (which I gather for historical reasons still
speaks HTTP/1.0) reported. Basically our RIFE application output a
blank page (after hanging for a couple of minutes) for a particular
request of the form:
http://data.itoworld.com/mysite/mypage?status=1
where "status" is declared as an input with flowlinks and datalinks in
the usual way. Perhaps the input is unwisely named (though I can find no
documentation whatever on reserved words which shouldn't be used in
query strings in HTTP). If I changed the input name from "status" to
something else e.g. "wst" everything works.
I have created a small RIFE web app with only two pages in it at:
http://data.itoworld.com/status_test/home
which can reliably reproduce the bug (files below). Old browser clients
such as Netscape 4.79 also have a problem and put up a dialog box:
"unknown status reply from server: 1"
or some such. The number at the end is the same as the input's value.
It looks like "status" is being treated as a reserved word at some
point, though in Netscape 4.79 the request works once the dialog box is
dismissed.
Is this a RIFE problem, or just something about HTTP/1.0 that I'm
missing? It would be good to be pointed at some relevant documentation
if it's the latter, as this could come back to bite us again.
Thanks for any help,
David Herbert
Itoworld
Cambridge UK.
----------------------------StatusTest.java---------------------------------------
/*
* Test for use of input "status" and possible confusion with HTTP
status in HTTP/1.0
*
* David Herbert
* Itoworld Ltd 22/09/06
*/
import com.uwyn.rife.engine.Element;
import com.uwyn.rife.template.Template;
public class StatusTest extends Element {
public void processElement() {
Template template = getHtmlTemplate( "status_test" );
setExitQuery( template, "statuslink", new String[] { "status",
"1" } );
print(template);
}
}
-----------------------------LinkPage.java-----------------------------------------
/*
* Test for use of input "status" and possible confusion with HTTP
status in HTTP/1.0
*
* David Herbert
* Itoworld Ltd 22/09/06
*/
import com.uwyn.rife.engine.Element;
import com.uwyn.rife.template.Template;
public class LinkPage extends Element {
public void processElement() {
Template template = getHtmlTemplate( "link_page" );
int statusVar = getInputInt( "status" );
template.setValue( "status_value", statusVar );
print( template );
}
}
------------------------------------participants.xml------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!--
-->
<!DOCTYPE rep SYSTEM "/dtd/rep.dtd">
<rep>
<participant param="status_test.xml">ParticipantSite</participant>
</rep>
----------------------------------status_test.xml------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!--
-->
<!DOCTYPE site SYSTEM "/dtd/site.dtd">
<site>
<element id="StatusTest" implementation="StatusTest" url="home">
<exit name="statuslink"/>
<output name="status"/>
<datalink srcoutput="status" destid="LinkPage" destinput="status"/>
<flowlink srcexit="statuslink" destid="LinkPage"/>
</element>
<element id="LinkPage" implementation="LinkPage" url="linkpage">
<input name="status"/>
</element>
</site>
-----------------------------------------status_test.html------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!--
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test for using an input called status</title>
</head>
<body>
<a href="[!V 'EXIT:QUERY:statuslink'/]">Click here to test</a>
</body>
</html>
---------------------------------------link_page.html----------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!--
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test for using an input called status link page</title>
</head>
<body>
Status value is <!--V 'status_value'/-->
</body>
</html>
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users