Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(request-termination): status_code cannot be set as null #9400

Merged
merged 1 commit into from Oct 31, 2022

Conversation

ms2008
Copy link
Contributor

@ms2008 ms2008 commented Sep 8, 2022

Summary

status_code should not be allowed to be set to null, otherwise a 500 error will be returned.

Full changelog

  • Do not allow set status_code as null

FTI-4291

@@ -1,5 +1,6 @@
local schema_def = require "kong.plugins.request-termination.schema"
local v = require("spec.helpers").validate_plugin_config_schema
local null = ngx.null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this localization is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be used in this line

local ok, err = v({status_code = null}, schema_def)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my meaning is that we can use ngx.null in this line, need not to localize it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters as it seems like a trivial style.🙂

@bungle bungle changed the title fix(request-termination): status_code can not be set as null fix(request-termination): status_code cannot be set as null Oct 20, 2022
@hbagdi
Copy link
Member

hbagdi commented Oct 26, 2022

@dndx Please hit the merge button.

@dndx dndx merged commit 3774c36 into master Oct 31, 2022
@dndx dndx deleted the fix/request-termination branch October 31, 2022 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants