solidjs / solid-start

SolidStart, the Solid app framework
https://start.solidjs.com
MIT License
4.93k stars 371 forks source link

Pass event to getResponseStatus in set statusCode #1532

Closed Brendonovich closed 2 weeks ago

Brendonovich commented 3 weeks ago

Makes behaviour of HttpStatusCode and fetchEvent a bit more consistent

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

Setting event.response.statusCode in non-AsyncLocalStorage environments currently throws an error from deep inside FetchEvent.

What is the new behavior?

HTTPStatusCode will now throw when calling getRequestEvent rather than while setting statusCode, which is a bit more understandable imo.

Other information

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: 19165e0024da84ebf2a5c872e4f3d16fb0d8fe62

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------- | ----- | | @solidjs/start | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

ryansolid commented 2 weeks ago

Thanks