Item14033: Implement MoveQueryPathParsingIntoFoswikiRequest
Priority: Urgent
Current State: Confirmed
Released In: 2.2.0
Target Release: minor
Restructure the Foswiki::Request, moving all parsing of path and topic= into the request object.
Will be implemented on a feature branch.
--
GeorgeClark - 26 Mar 2016
Just checked the last commit on this task. I think the code which creates the final request object should be extracted into a separate sub declared in Engine.pm. Something like
createRequest($action)
. It doesn't depend on particular engine anyway but should be used by all of them.
--
VadimBelman - 04 Apr 2016
Crashes on any switchboard entry specified as an ARRAY. See comments at
https://github.com/foswiki/distro/commit/3897d8900a0d1cd21fb1cce7b92bf24dbd2ee68a
--
MichaelDaum - 03 Jun 2016
Caching json-rpc is quite broken: before the POSTDATA string was used as part of the variation key of a cached page. This is not there anymore with the new request structure: POSTDATA is ignored now as it is not accessible via
param()
anymore. As a result the wrong cached page gets servered to the json-rpc handler which tries to interprete it as a json object ... which it isn't.
--
MichaelDaum - 03 Jun 2016
POSTDATA really should still be reachable by param. Unless the requested param exists in the JSON param hash, the routine returns Super param. I need some sort of a test case to debug it. Ideally we add a json test into the
CacheTests.
--
GeorgeClark - 03 Jun 2016
rest on cmdline is broken with an error saying
Can't locate object method "invalidSubject" via package "Foswiki::Request"
--
MichaelDaum - 06 Jun 2016
Fixed the command line, still need a testcase for the jsonrpc caching.
--
GeorgeClark - 06 Jun 2016
I've got cached jsonrpc working again. It basically boild down to
- the param list not returning POSTDATA,
- POSTDATA not being accessible at all, even not via
$this->SUPER::param(...)
and
- the
multi_param()
method of the super class not interacting properly with the json request's param()
method
Will check it in tomorrow...
--
MichaelDaum - 08 Jun 2016
Subwebs separated by dots instead of webs aren't supported anymore, eg. https://foswiki.org/Extensions.Testing/WebHome will assign
web=Extensions, topic=Testing/WebHome
. See
this diff.
--
MichaelDaum - 14 Jun 2016
%QUERYSTRING%
should not return POSTDATA
--
MichaelDaum - 15 Jun 2016
Fixed the parsing of Web.Subweb.Topic. Not sure what's going on with the QUERYSTRING.
--
GeorgeClark - 28 Jun 2016
I think for postdata in the query string, this should do it.
diff --git a/core/lib/Foswiki/Request.pm b/core/lib/Foswiki/Request.pm
index 858616e..c9d1f58 100644
--- a/core/lib/Foswiki/Request.pm
+++ b/core/lib/Foswiki/Request.pm
@@ -242,6 +242,7 @@ sub queryString {
my $this = shift;
my @params;
foreach my $name ( $this->param ) {
+ next if ( $name eq 'POSTDATA' );
my $key = Foswiki::urlEncode($name);
push @params,
map { $key . "=" . Foswiki::urlEncode( defined $_ ? $_ : '' ) }
--
GeorgeClark - 28 Jun 2016
This is part of the fix. However the sh* piles higher.
--
MichaelDaum - 05 Jul 2016
This checkin breaks backwards compatibility of
FastCGIEngineContrib and
ModPerlEngineContrib ... something we should avoid on the Foswiki-2 branch.
--
MichaelDaum - 14 Jul 2016
See
Item15114.
--
MichaelDaum - 05 May 2022