Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a bug in the RailsBaseURI/RackBaseURI verification code: allow '/'.

  • Loading branch information...
commit eaf2f630523927f2f0481cf32f1e9f480b77a375 1 parent ac777e5
@FooBarWidget FooBarWidget authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 ext/apache2/Configuration.cpp
View
4 ext/apache2/Configuration.cpp
@@ -450,7 +450,7 @@ cmd_rails_base_uri(cmd_parms *cmd, void *pcfg, const char *arg) {
return "RailsBaseURI may not be set to the empty string";
} else if (arg[0] != '/') {
return "RailsBaseURI must start with a slash (/)";
- } else if (arg[strlen(arg) - 1] == '/') {
+ } else if (strlen(arg) > 1 && arg[strlen(arg) - 1] == '/') {
return "RailsBaseURI must not end with a slash (/)";
} else {
config->railsBaseURIs.insert(arg);
@@ -540,7 +540,7 @@ cmd_rack_base_uri(cmd_parms *cmd, void *pcfg, const char *arg) {
return "RackBaseURI may not be set to the empty string";
} else if (arg[0] != '/') {
return "RackBaseURI must start with a slash (/)";
- } else if (arg[strlen(arg) - 1] == '/') {
+ } else if (strlen(arg) > 1 && arg[strlen(arg) - 1] == '/') {
return "RackBaseURI must not end with a slash (/)";
} else {
config->rackBaseURIs.insert(arg);
Please sign in to comment.
Something went wrong with that request. Please try again.