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

Relationship field - 431 (Request Header Fields Too Large) #6486

Closed
andershermansen opened this issue May 24, 2024 · 1 comment
Closed

Relationship field - 431 (Request Header Fields Too Large) #6486

andershermansen opened this issue May 24, 2024 · 1 comment

Comments

@andershermansen
Copy link
Contributor

Link to reproduction

No response

Payload Version

3.0.0-beta.36

Node Version

v22.1.0

Next.js Version

15.0.0-rc.0

Describe the Bug

When you add new items to a relationship field the system will query which items should be listed. The query will have a not_in list so that currently selected items will not show up again in the list to add again. When you have a lot of items this not_in list will become quite large. As the query to show the options is a GET request it will eventually fail with 431 (Request Header Fields Too Large) when the number of items in the relationship field makes the query too long for what is allowed by browser/http standard.

Ref discussion #1977

Reproduction Steps

  • Have a field of type relationship field and allow hasMany
  • Add many items to the relationship field (many many 100s)
  • After adding enough items to the field it will eventuall give 431 (Request Header Fields Too Large) error

Adapters and Plugins

No response

JarrodMFlesch pushed a commit that referenced this issue Jun 13, 2024
Fixes: #6486

Adds `X-HTTP-Method-Override` header to allow for sending query params in the body of a POST request. This is useful when the query param string hits the upper limit.
Copy link

github-actions bot commented Sep 7, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants