class twisted.web.util.ParentRedirect(resource.Resource): (source)
Redirect to the nearest directory and strip any query string.
This generates redirects like:
/ → / /foo → / /foo?bar → / /foo/ → /foo/ /foo/bar → /foo/ /foo/bar?baz → /foo/
However, the generated Location header contains an absolute URL rather than a path.
The response is the same regardless of HTTP method.
Class Variable | isLeaf | Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource. |
Method | render | Respond to all requests by redirecting to nearest directory. |
Inherited from Resource:
Class Variable | server | Undocumented |
Method | __init__ | Initialize. |
Instance Variable | children | Undocumented |
Method | listStaticNames | Undocumented |
Method | listStaticEntities | Undocumented |
Method | listNames | Undocumented |
Method | listEntities | Undocumented |
Method | listDynamicNames | Undocumented |
Method | listDynamicEntities | Undocumented |
Method | getStaticEntity | Undocumented |
Method | getDynamicEntity | Undocumented |
Method | delEntity | Undocumented |
Method | reallyPutEntity | Undocumented |
Method | getChild | Retrieve a 'child' resource from me. |
Method | getChildWithDefault | Retrieve a static or dynamically generated child resource from me. |
Method | getChildForRequest | Undocumented |
Method | putChild | Register a static child. |
Method | render_HEAD | Default handling of HEAD method. |
Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource.
int
)
Respond to all requests by redirecting to nearest directory.
Returns | Undocumented (type: bytes ) |