Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1606 (closed defect: fixed)

Opened 10 years ago

Last modified 9 years ago

[PATCH] An access outside "server.webpath" raises NotFound, but returns content.

Reported by: htanaka Owned by: anonymous
Priority: normal Milestone: 1.5
Component: TurboGears Version: 1.0.3.2
Severity: normal Keywords:
Cc:

Description

I'm setting like below to mount my application as subcontents of our website.

server.webpath = "/myapp"

When I visit to "localhost:8080/" instead of "localhost:8080/myapp/", the NotFound? error appears on console or file. But my web browser gets content which it had be shown without "server.webpath" setting. It should be HTTP error of 404.

Even if developers forget ${tg.url(...)}, it might not be noticed while running with local computer.

In VirtualPathFilter? of /turbogears/startup.py, I found that you don't want to show content in this case.

141:        raise cherrypy.NotFound(path)

But any exception from "on_start_resource" handler is not treated in CherryPy2.2.1. The first handler that can handle exceptions is "before_request_body".

I propose this patch for startup.py :

132c132
<     def before_request_body(self):
---
>     def on_start_resource(self):

Change History

comment:1 Changed 10 years ago by faide

  • Milestone changed from 1.0.4 to 1.1
  • Summary changed from An access outside "server.webpath" raises NotFound, but returns content. to [PATCH] An access outside "server.webpath" raises NotFound, but returns content.

comment:2 Changed 9 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r5145.

Note: See TracTickets for help on using tickets.