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 3scale#1165
Fix THREESCALE-4605

Signed-off-by: Eloy Coto <[email protected]>
  • Loading branch information
eloycoto committed Mar 7, 2020
1 parent e71467f commit 1331dc9
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/).
## [3.8.0-alpha2] - 2019-02-18

- 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 1331dc9

Please sign in to comment.