« Back to Search  |  Reader Mode  |  Switch to Full Retro Site View Links: Stay in Reader  |  Retro Mode: ON  |  Original »
GitHub · Extracted in 1556 ms

GETS/HEADS/PUT/DELETE 不允许前端传 @combine by cloudAndMonkey · Pull Request #494 · APIJSON/APIJSON

Source: https://github.com/APIJSON/APIJSON/pull/494

Repository navigation

GETS/HEADS/PUT/DELETE 不允许前端传 @combine - #494


Merged
TommyLemon merged 2 commits into APIJSON:master from cloudAndMonkey:master Jan 9, 2023
Merged

GETS/HEADS/PUT/DELETE 不允许前端传 @combine #494 TommyLemon merged 2 commits into APIJSON:master from cloudAndMonkey:master

Conversation

cloudAndMonkey commented Jan 9, 2023



Copy link Copy Markdown
Contributor

#493
GETS/HEADS/PUT/DELETE 不允许前端传 @combine ,目前在这里去掉了校验,需要在 AbstractVerifier 补上,这样就只能通过后端配置 @combine 了,既保证了功能,又保证了安全

GETS/HEADS/PUT/DELETE 不允许前端传 @combine e94c44f
APIJSON#493
GETS/HEADS/PUT/DELETE 不允许前端传 @combine,目前在这里去掉了校验,需要在 AbstractVerifier 补上,这样就只能通过后端配置 @combine 了,既保证了功能,又保证了安全

TommyLemon commented Jan 9, 2023 · edited Loading



Copy link Copy Markdown
Member

@cloudAndMonkey 这里少了 PUT 哈

if (combine != null && (_method == RequestMethod.DELETE || _method == RequestMethod.GETS || _method == RequestMethod.HEADS))

可以直接用 RequestMethod.isQueryMehtod(_method) == false 判断,
还可以在 RequestMethod 新增一个 isUpdateMehtod,返回值是 ! isQueryMehtod

cloudAndMonkey commented Jan 9, 2023 · edited Loading



Copy link Copy Markdown
Contributor

Author

@TommyLemon
用RequestMethod.isPublicMethod(_method) == false 判断即可

更正,开放请求 GET、HEAD 才允许传 @combine:value 8bf7195 TommyLemon merged commit fb3fa39 into APIJSON : master Jan 9, 2023 Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

2 participants