Skip to content

Expose status code from policy object? #51

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

Open
hexchain opened this issue Apr 28, 2025 · 1 comment · May be fixed by #52
Open

Expose status code from policy object? #51

hexchain opened this issue Apr 28, 2025 · 1 comment · May be fixed by #52

Comments

@hexchain
Copy link

In one of my project where I get to implement a cache, I store the response body (content) and the policy (via .toObject()) together. When assembling a response from cache, I have access to the body and the header through the policy object, but not the status code. Since it is already stored in the policy, would it be good to also expose it (e.g. directly with a new .statusCode() API, or from evaluateRequest() or revalidatedPolicy())?

@kornelski
Copy link
Owner

Yeah, I think it would make sense to add it to the various Response objects exposed by the API.

@hexchain hexchain linked a pull request May 1, 2025 that will close this issue
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 a pull request may close this issue.

2 participants