GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GETS/HEADS/PUT/DELETE 不允许前端传 @combine by cloudAndMonkey · Pull Request #494 · APIJSON/APIJSON

Conversation

@cloudAndMonkey

@cloudAndMonkey cloudAndMonkey commented Jan 9, 2023

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyLemon reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@cloudAndMonkey
GETS/HEADS/PUT/DELETE 不允许前端传 @combine
e94c44f
APIJSON#493
GETS/HEADS/PUT/DELETE 不允许前端传 @combine,目前在这里去掉了校验,需要在 AbstractVerifier 补上,这样就只能通过后端配置 @combine 了,既保证了功能,又保证了安全
@TommyLemon

TommyLemon commented Jan 9, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cloudAndMonkey

cloudAndMonkey commented Jan 9, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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

TommyLemon reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cloudAndMonkey
更正,开放请求 GET、HEAD 才允许传 @combine:value
8bf7195
@TommyLemon
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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@cloudAndMonkey @TommyLemon
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.