Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题描述:当对执行器进行手动注册的时候,缺乏简单的HTTP地址合法校验,会导致后续事件调用的失败。
解决方案:先把url进行前后缀空格去除,然后把它变成小写,进行下一步验证。
验证思路(若url不含有http://,不含有https://,含有空格,则说明该url为不合法。)
if(!url.startsWith("http://") && !url.startsWith("https://") && url.contains(" ")){ return false; }
当然这里只是提供了较为简单的合法性校验,同时我觉得也是必要的,因为当用户进行手动注册时若没有符合相应规则,则对后续的调用失败。
如下为修改前后的图片信息:
XXL-JOB开源.docx