#46 Let non reletive urls work in forward() and includeURL()

closed-fixed
WebKit (45)
5
2003-01-16
2003-01-12
Luke Holden
No

if you use:
self.forward("/someurl")

It is treated reletive to the current directory.

So if you are in the directory
/auth/actions

you get:
/auth/actions/someurl

which is not what you would expect...

This patch changes forward and includeURL to detect if
your trying to use a file from the root directory, and
if you are.. adds req.siteRoot() as needed.

so self.forward("/someurl")
will work as expected

however:
so self.forward("someurl")
will still work reletive to the current directory.

Discussion

  • Stuart Donaldson

    Logged In: YES
    user_id=326269

    This is closely related to the path parsing problems I am
    looking at right now. This works in some cases, but on its
    own, it fails with ExtraPathInfo in FindServlet I think.

    I'm looking into this further right now. Thanks for the
    Patch, I'll likely use a good part of it.

     
  • Stuart Donaldson

    • assigned_to: nobody --> stuartd
     
  • Luke Holden

    Luke Holden - 2003-01-12

    Logged In: YES
    user_id=56099

    Unfortunatly... it looks like an includeURL right after a
    forward does not work =/

    For some reason transaction.request().serverSidePath()
    gets set to None

    File
    "/home/alterself/public_html/lib/layout/SiteLayout.py", line
    6, in writeHTMLBody
    self.includeURL("/navigation/nav")
    File "./WebKit/Page.py", line 340, in includeURL
    File "/opt/Webware/WebKit/Application.py", line 672, in
    includeURL
    self.createServletInTransaction(trans)
    File "/opt/Webware/WebKit/Application.py", line 1000, in
    createServletInTransaction
    assert path is not None

     
  • Luke Holden

    Luke Holden - 2003-01-13

    Logged In: YES
    user_id=56099

    Okay, attached is another patch. (Application_lholden2.diff)
    It fixes the problem with includes after a forward.

    Apply this after the first patch

     
  • Stuart Donaldson

    Logged In: YES
    user_id=326269

    I am attatching a revised patch. It is a tarball containing
    a diff which includes most of what Luke had already done. I
    moved things around a little, and updated the RelNotes.

    I added some test cases under WebKit/Testing at the end of
    the test list.

     
  • Stuart Donaldson

    Logged In: YES
    user_id=326269

    Oops, spoke to soon on the consolidated patch. Some
    debugging code in other parts of Webware was apparently
    required by this. I'll clean it up and re-post.

     
  • Stuart Donaldson

    Revised consolidated patch from Stuart.

     
  • Stuart Donaldson

    Logged In: YES
    user_id=326269

    Ok, try this consolidated patch. It also includes an update
    to WebKit/Testing so check that out as well.

    There are some differences with handling URL references when
    ExtraPathInfo is set or not. This was developed and tested
    with it set. When it is not set, the testing code currently
    will show some different values when referencing the URL
    '/'. This is because that is parsed slightly differently
    under the two circumstances.

     
  • Stuart Donaldson

    Logged In: YES
    user_id=326269

    Patches have been applied, closing this report.
    Any new changes should be entered in via a new patch or bug
    report.

     
  • Stuart Donaldson

    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks