Permalink
Browse files

Ignore RailsAllowModRewrite directive for Rails base URIs. Fixes issue

  • Loading branch information...
FooBarWidget committed Apr 26, 2008
1 parent bd59941 commit 59838b9704e6fa966b51f93379fed10d13a7dae9
Showing with 9 additions and 2 deletions.
  1. +9 −2 ext/apache2/Hooks.cpp
View
@@ -453,9 +453,10 @@ class Hooks {
mapToStorage(request_rec *r) {
DirConfig *config = getDirConfig(r);
bool forwardToRails;
+ const char *baseURI;
- if (determineRailsBaseURI(r, config) == NULL
- || fileExists(r->filename)) {
+ baseURI = determineRailsBaseURI(r, config);
+ if (baseURI == NULL || fileExists(r->filename)) {
/*
* fileExists():
* If the file already exists, serve it directly.
@@ -517,6 +518,12 @@ class Hooks {
* interfere.
*/
return OK;
+ } else if (strcmp(r->uri, baseURI) == 0) {
+ /* But we ignore RailsAllowModRewrite for the base URI of
+ * the Rails application. Otherwise, Apache will show a
+ * directory listing. This fixes issue #11.
+ */
+ return OK;
} else {
return DECLINED;
}

0 comments on commit 59838b9

Please sign in to comment.