Ticket #1606 (closed defect: fixed)

Opened 1 year ago

Last modified 3 months ago

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

Reported by: htanaka Assigned to: 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 CherryPy?2.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

11/25/07 11:57:47 changed by faide

  • 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..
  • milestone changed from 1.0.4 to 1.1.

08/13/08 17:50:40 changed by chrisz

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r5145.