Skip to content

Commit

Permalink
nghttpx: Fix mruby parameter validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Sep 30, 2018
1 parent 87ac872 commit fc7489e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/shrpx_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1056,12 +1056,14 @@ int parse_mapping(Config *config, DownstreamAddrConfig &addr,
// If some backends do not specify mruby file, and there is at
// least one backend with mruby file, it is used for all
// backends in the group.
if (g.mruby_file.empty()) {
g.mruby_file = make_string_ref(downstreamconf.balloc, params.mruby);
} else if (g.mruby_file != params.mruby) {
LOG(ERROR) << "backend: mruby: multiple different mruby file found in "
"a single group";
return -1;
if (!params.mruby.empty()) {
if (g.mruby_file.empty()) {
g.mruby_file = make_string_ref(downstreamconf.balloc, params.mruby);
} else if (g.mruby_file != params.mruby) {
LOG(ERROR) << "backend: mruby: multiple different mruby file found "
"in a single group";
return -1;
}
}

g.addrs.push_back(addr);
Expand Down

0 comments on commit fc7489e

Please sign in to comment.