Apache2-ClickPath
view release on metacpan or search on metacpan
relative links anymore
1.1a Thu Jan 13 17:08:19 CET 2005
* Torsten Foertsch <torsten.foertsch@gmx.net>
- Bugfix: the handler crashed without a <ClickPathUAExceptions>
section
1.1 Tue Jan 11 14:50:20 CET 2005
* Torsten Foertsch <torsten.foertsch@gmx.net>
- <area> (image maps) support
- <frame> und <iframe> support
- ClickPathMachine directive
- ClickPathUAExceptions directive
- ClickPathFriendlySessions directive
- ClickPathUAExceptionsFile directive
- ClickPathFriendlySessionsFile directive
1.0 Mon Dec 13 10:22:15 CET 2004
* Torsten Foertsch <torsten.foertsch@gmx.net>
- original version
It prepends the session prefix and identifier to any "Location" an
"Refresh" output headers.
If the output "Content-Type" is "text/html" the body part is modified.
In this case the filter patches the following HTML tags:
<a ... href="LINK" ...>
<area ... href="LINK" ...>
<form ... action="LINK" ...>
<frame ... src="LINK" ...>
<iframe ... src="LINK" ...>
<meta ... http-equiv="refresh" ... content="N; URL=LINK" ...>
In all cases if "LINK" starts with a slash the current value of
"CGI_SESSION" is prepended. If "LINK" starts with "http://HOST/" (or
https:) where "HOST" matches the incoming "Host" header
"CGI_SESSION" is inserted right after "HOST". If "LINK" is relative
and the incoming request URI had contained a session then "LINK" is
left unmodified. Otherwize it is converted to a link starting with a
slash and "CGI_SESSION" is prepended.
Configuration Directives
lib/Apache2/ClickPath.pm view on Meta::CPAN
) # Das alles ist in $1
(?:/+\Q$sprefix\E[^/]+)?
( # $3 start
(?!\w+:).*? # ein beliebiger nicht mit http:// o.ae.
# beginnender String (moeglichst kurz)
\2 # das schlieÃende Quote: $2
) # $3 ende
,xi;
$re4=qr,( # $1 start
<\s*i?frame\s+ # <a> start
[^>]*? # evtl. target=...
\bsrc\s*=\s* # href=
(["']) # " oder ': Das ist $2 oder \2 (siehe unten)
(?:https?://\Q$host\E)? # evtl. Host
) # Das alles ist in $1
(?:/+\Q$sprefix\E[^/]+)?
( # $3 start
(?!\w+:).*? # ein beliebiger nicht mit http:// o.ae.
# beginnender String (moeglichst kurz)
\2 # das schlieÃende Quote: $2
lib/Apache2/ClickPath.pm view on Meta::CPAN
) # Das alles ist in $1
(?:/+\Q$sprefix\E[^/]+)?
( # $3 start
/.*? # ein beliebiger /
# beginnender String (moeglichst kurz)
\2 # das schlieÃende Quote: $2
) # $3 ende
,xi;
$re4=qr,( # $1 start
<\s*i?frame\s+ # <a> start
[^>]*? # evtl. target=...
\bsrc\s*=\s* # href=
(["']) # " oder ': Das ist $2 oder \2 (siehe unten)
(?:https?://\Q$host\E)? # evtl. Host
) # Das alles ist in $1
(?:/+\Q$sprefix\E[^/]+)?
( # $3 start
/.*? # ein beliebiger /
# beginnender String (moeglichst kurz)
\2 # das schlieÃende Quote: $2
lib/Apache2/ClickPath.pm view on Meta::CPAN
In this case the filter patches the following HTML tags:
=over 4
=item B<E<lt>a ... href="LINK" ...E<gt>>
=item B<E<lt>area ... href="LINK" ...E<gt>>
=item B<E<lt>form ... action="LINK" ...E<gt>>
=item B<E<lt>frame ... src="LINK" ...E<gt>>
=item B<E<lt>iframe ... src="LINK" ...E<gt>>
=item B<E<lt>meta ... http-equiv="refresh" ... content="N; URL=LINK" ...E<gt>>
In all cases if C<LINK> starts with a slash the current value of
C<CGI_SESSION> is prepended. If C<LINK> starts with
C<http://HOST/> (or https:) where C<HOST> matches the incoming C<Host>
header C<CGI_SESSION> is inserted right after C<HOST>. If C<LINK> is
relative and the incoming request URI had contained a session then C<LINK>
is left unmodified. Otherwize it is converted to a link starting with a slash
and C<CGI_SESSION> is prepended.
t/session/003output_body.t view on Meta::CPAN
<a href="../index1.html">3</a>
<a href="http://x.y/index1.html">4</a>
<area href="/index1.html">1</area>
<area href="http://$hostport/index1.html">2</area>
<AREA title='klaus' href="../index1.html" coords="1,2,3,4,5">3</AREA>
<area title="klaus" href="http://x.y/index1.html" coords='1,2,3,4,5'>4</area>
<form action="/index1.html">1</form>
<form action="http://$hostport/index1.html">2</form>
<form action="../index1.html">3</form>
<form action="http://x.y/index1.html">4</form>
<frame src="/index1.html">1</frame>
<FRAME blub="bla" SRC="http://$hostport/index1.html">2</frame>
<frame src="../index1.html">3</frame>
<frame src="http://x.y/index1.html">4</frame>
<iframe src="/index1.html">1</iframe>
<iframe src="http://$hostport/index1.html">2</iframe>
<iframe src="../index1.html">3</iframe>
<iframe src="http://x.y/index1.html">4</iframe>
</body>
</html>
EOF
close F;
open F, ">t/htdocs/tmp/y.html" and print F <<"EOF";
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
t/session/003output_body.t view on Meta::CPAN
ok( t_cmp( $got, qr!<form action="\Q$session\E/index1\.html">1</form>! ),
"form 1" );
ok( t_cmp( $got, qr!<form action="http://\Q$hostport$session\E/index1\.html">2</form>! ),
"form 2" );
ok( t_cmp( $got, qr!<form action="\.\./index1\.html">3</form>! ),
"form 3" );
ok( t_cmp( $got, qr!<form action="http://x.y/index1.html">4</form>! ),
"form 4" );
ok( t_cmp( $got, qr!<frame src="\Q$session\E/index1\.html">1</frame>! ),
"frame 1" );
ok( t_cmp( $got, qr!<FRAME blub="bla" SRC="http://\Q$hostport$session\E/index1\.html">2</frame>! ),
"frame 2" );
ok( t_cmp( $got, qr!<frame src="\.\./index1\.html">3</frame>! ),
"frame 3" );
ok( t_cmp( $got, qr!<frame src="http://x.y/index1.html">4</frame>! ),
"frame 4" );
ok( t_cmp( $got, qr!<iframe src="\Q$session\E/index1\.html">1</iframe>! ),
"iframe 1" );
ok( t_cmp( $got, qr!<iframe src="http://\Q$hostport$session\E/index1\.html">2</iframe>! ),
"iframe 2" );
ok( t_cmp( $got, qr!<iframe src="\.\./index1\.html">3</iframe>! ),
"iframe 3" );
ok( t_cmp( $got, qr!<iframe src="http://x.y/index1.html">4</iframe>! ),
"iframe 4" );
$got=GET_BODY( "$session/tmp/y.html", redirect_ok=>0 );
ok( t_cmp( $got, qr!<meta HTTP-EQUIV=REFRESH CONTENT="0; URL=\Q$session\E/klaus/view/index\.shtml">! ),
"y.html - <meta>" );
ok( t_cmp( $got, qr!<a href="\Q$session\E/klaus/view/index\.shtml">! ),
"y.html - <a>" );
# Local Variables: #
# mode: cperl #
# End: #
( run in 0.358 second using v1.01-cache-2.11-cpan-e1769b4cff6 )