Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swazoo adapter does not respect Request URIs ending in slash. #694

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

commented Mar 25, 2015

http://code.google.com/p/glassdb/issues/detail?id=300

Retrieving a Seaside WAUrl from a SwazooUri in 
WAServerAdaptor>>requestUrlFor: does not account for the possibility that 
the uri might end in a slash.

This turned out to be a problem in a recent SqueakSource version where this 
lead to an infinite redirect. The FastCGI-version does not seem to have this 
problem.

Solution: in WAServerAdaptor>>requestUrlFor: 
a line "seasideUrl slash: swazooUri isDirectory." should be added.
See below.

WAServerAdaptor>>requestUrlFor: aNativeRequest
    | swazooUri seasideUrl |
    seasideUrl := WAUrl new.
    swazooUri := aNativeRequest uri.
    swazooUri identifierPath do: [ :each |
        "the first path element seems to always be '/'"
        each = '/' ifFalse: [
            seasideUrl addToPath: each ] ].
    seasideUrl slash: swazooUri isDirectory. "<- new"
    swazooUri queries do: [ :each |
        | value |
        value := each value.
        "non-existing values are implemented as ''"
        value isEmpty
            ifTrue: [ seasideUrl addField: each key ]
            ifFalse: [ seasideUrl addField: each key value: value ] ].

    aNativeRequest isEncrypted
        ifTrue: [ seasideUrl scheme: 'https' ].

    ^ seasideUrl decodedWith: self codec

Original issue reported on code.google.com by philippe...@gmail.com on 5 Oct 2011 at 4:52

@GoogleCodeExporter

This comment has been minimized.

Copy link
Author

commented Mar 25, 2015

Name: Seaside-Adaptors-Swazoo-pmm.42
Author: pmm
Time: 5 October 2011, 8:19:45 pm
UUID: cb152929-d68d-4496-a16d-6fb6fd1f187e
Ancestors: Seaside-Adaptors-Swazoo-pmm.41

- Issue 694:    Swazoo adapter does not respect Request URIs ending in slash.

Original comment by philippe...@gmail.com on 5 Oct 2011 at 6:20

  • Changed state: Fixed
  • Added labels: Version-Seaside3.0
  • Removed labels: ****
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.