You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, headers such as Accept-Language are parsed and validated eagerly, even if the request handler does not actually read or use them. This can lead to unnecessary rejections of requests with invalid headers, even though those headers are irrelevant to the processing logic. This behavior might not align with how other server frameworks handle unused headers, as they may only parse or validate headers on demand.
Describe the solution you'd like
Implement lazy loading for header parsing and validation. Instead of parsing all headers upfront, headers should only be parsed or validated when explicitly accessed by the request handler. This approach can:
Improve performance by skipping unnecessary work.
Avoid rejecting requests for irrelevant headers.
Provide behavior more in line with other server frameworks.
Describe alternatives you've considered
Eager Parsing with Error Suppression: Continue parsing headers eagerly but suppress validation errors for unused headers. However, this might lead to silent failures and make debugging harder.
Selective Parsing via Configuration: Allow developers to configure which headers to validate. This adds complexity and requires developers to be proactive about configurations.
Additional context
The current behavior raises questions about the wisdom of rejecting requests based on irrelevant headers. This issue aligns with making the framework more efficient and user-friendly. Lazy loading is a common pattern used in many frameworks to avoid unnecessary overhead.
Is your feature request related to a problem? Please describe.
Currently, headers such as
Accept-Language
are parsed and validated eagerly, even if the request handler does not actually read or use them. This can lead to unnecessary rejections of requests with invalid headers, even though those headers are irrelevant to the processing logic. This behavior might not align with how other server frameworks handle unused headers, as they may only parse or validate headers on demand.Describe the solution you'd like
Implement lazy loading for header parsing and validation. Instead of parsing all headers upfront, headers should only be parsed or validated when explicitly accessed by the request handler. This approach can:
Describe alternatives you've considered
Additional context
The current behavior raises questions about the wisdom of rejecting requests based on irrelevant headers. This issue aligns with making the framework more efficient and user-friendly. Lazy loading is a common pattern used in many frameworks to avoid unnecessary overhead.
Feedback: serverpod/serverpod#2744 (comment)
The text was updated successfully, but these errors were encountered: