Skip to content

Commit

Permalink
Policy::Logging: Fix crash on invalid config.
Browse files Browse the repository at this point in the history
If the logging config is not correct,operations are not defined,the loop
will not work and it'll crash.

Fix #1165
Fix THREESCALE-4605

Signed-off-by: Eloy Coto <eloy.coto@gmail.com>
  • Loading branch information
eloycoto committed Mar 2, 2020
1 parent bfbc0cb commit e85a94e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]

- Fixed naming issues in policies [THREESCALE-4150](https://issues.jboss.org/browse/THREESCALE-4150) [PR #1167](https://github.com/3scale/APIcast/pull/1167)
- Fixed issues on invalid config in logging policy [THREESCALE-4605](https://issues.jboss.org/browse/THREESCALE-4605) [PR #1168](https://github.com/3scale/APIcast/pull/1168)

## [3.7.0-alpha2]

Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/logging/logging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function _M:load_condition(config)

ngx.log(ngx.DEBUG, 'Enabling extended log with conditions')
local operations = {}
for _, operation in ipairs(config.condition.operations) do
for _, operation in ipairs(config.condition.operations or {}) do
table.insert( operations,
Operation.new(
operation.match, operation.match_type,
Expand Down

0 comments on commit e85a94e

Please sign in to comment.