WAResponseGenerator>>expiredKey

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

WAResponseGenerator>>expiredKey

Nick
Hi,

Selecting a different look using Pier's PRDesignChooserWidget causes an WAUnregisteredHandlerError exception to be raised. This occurs on the latest builds: http://hudson.lukas-renggli.ch/job/Pier%202/lastBuild/

The PRDesignChooserWidget registers 'pier' with the new structure in place then sends an #expiredKey response as:

    self requestContext responseGenerator
        expiredKey;
        respond

The problem appears to be in a change to WAResponseGenerator>>expiredKey, which was introduced:

---
Name: Seaside-Core-YM.639
Author: YM
Time: 22 May 2010, 7:39:33 pm
UUID: e24bae83-3671-4679-ac8d-9f21154c304e
Ancestors: Seaside-Core-pmm.638


- Corrected WAResponseGenerator>>#expiredKey to always use the correct URL
- Implemented WAPathConsumer>>#upToEnd
----

The exception is thrown in the line:
url := self requestContext handler url.

#handler returns a WASession which I presume wasn't expected when the code was written.

Changing the code to:

url := self requestContext request url

stops the exception from being thrown, but doesn't result in a URL free from keys; not the desired effect. I found a handy Pier extension method WAUrl>>purgeSeasideFields.The rewritten WAResponseGenerator>>expiredKey then becomes:

expiredKey
"The session key has expired, redirect the request to the home directory preserving the path as well as possible."

| url |
self request isXmlHttpRequest
ifTrue: [ ^ self forbidden ].
url := self requestContext request url.
url addAllToPath: self requestContext consumer upToEnd.
self request isGet ifTrue: [
url purgeSeasideFields].
self response redirectTo: url

With the requirement that the WAUrl>>purgeSeasideFields is moved from Pier-Seaside-Mapping into Seaside-Core-HTTP.

Thoughts?

Nick





_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: WAResponseGenerator>>expiredKey

Nick
Under Julian's guidance we fixed this issue, with both a fix to Seaside WAResponseGenerator>> expiredRegistryKey and some fixes to PRDesignChooserWidget>>renderContentOn:


Name: Seaside-Core-Nick.644
Author: Nick
Time: 13 June 2010, 5:57:22 pm
UUID: 967def9d-0131-4ec8-bd40-b27d13987f57
Ancestors: Seaside-Core-pmm.643

Fix #expiredKey to use the registry URL instead of the session URL when redirecting. Then rename it to #expiredRegistryKey in order to be explicit.

----

Name: Pier-Setup-Nick.84
Author: Nick
Time: 13 June 2010, 5:53:32 pm
UUID: 450e1618-0911-4061-91e6-ede14bdfcb58
Ancestors: Pier-Setup-lr.83

redirecting back to Pier after a new application is registered didn't work on latest Seaside. New implementation more specific about what we're trying to achieve.  Consider reviewing code in PRDistribution>>register

--


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: [Seaside-dev] Re: WAResponseGenerator>>expiredKey

Lukas Renggli
It is great that this issue could be fixed so quickly :-)

Lukas

On 14 June 2010 00:47, Nick Ager <[hidden email]> wrote:

> Under Julian's guidance we fixed this issue, with both a fix to
> Seaside WAResponseGenerator>> expiredRegistryKey and some fixes to
> PRDesignChooserWidget>>renderContentOn:
>
> Name: Seaside-Core-Nick.644
> Author: Nick
> Time: 13 June 2010, 5:57:22 pm
> UUID: 967def9d-0131-4ec8-bd40-b27d13987f57
> Ancestors: Seaside-Core-pmm.643
> Fix #expiredKey to use the registry URL instead of the session URL when
> redirecting. Then rename it to #expiredRegistryKey in order to be explicit.
> ----
> Name: Pier-Setup-Nick.84
> Author: Nick
> Time: 13 June 2010, 5:53:32 pm
> UUID: 450e1618-0911-4061-91e6-ede14bdfcb58
> Ancestors: Pier-Setup-lr.83
> redirecting back to Pier after a new application is registered didn't work
> on latest Seaside. New implementation more specific about what we're trying
> to achieve.  Consider reviewing code in PRDistribution>>register
> --
>
> _______________________________________________
> seaside-dev mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki