Skip to content

fix: graphql post request route matching exception#10198

Merged
juststillthinking merged 6 commits into
apache:masterfrom
AlinsRan:fix/match-opts
Sep 14, 2023
Merged

fix: graphql post request route matching exception#10198
juststillthinking merged 6 commits into
apache:masterfrom
AlinsRan:fix/match-opts

Conversation

@AlinsRan

@AlinsRan AlinsRan commented Sep 14, 2023

Copy link
Copy Markdown
Contributor

Description

Reuse of match_opts causes the value of the next request to overwrite the value of the current request. GraphQL requests call the ngx.req.read_body API, which is a non-blocking call. If the request body has not been fully read (for example, if the body size exceeds the nginx buffer), the coroutine will yield. If there are other requests during this time period, match_opts will be contaminated by other requests, resulting in matching the wrong route.

Fixes: #10197

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@AlinsRan
AlinsRan marked this pull request as ready for review September 14, 2023 01:18
Comment thread apisix/http/router/radixtree_host_uri.lua
Comment thread apisix/http/router/radixtree_host_uri.lua Outdated
@juststillthinking
juststillthinking merged commit ca80873 into apache:master Sep 14, 2023
shreemaan-abhishek pushed a commit to shreemaan-abhishek/apisix that referenced this pull request Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: graphql post request route matching exception

3 participants