-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Initial abstract classes #32298
Initial abstract classes #32298
Conversation
abstract getHeader(name: string): string | string[] | undefined | ||
|
||
abstract getAllHeaders(): Record<string, string | string[]> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also need to add abstract methods for getting a cookie/all cookies. I know that in the web side, we'll have to do some extra implementation for Set-Cookie
headers, so we might also have to inject some cookies into the request, but not 100% sure if needed yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's already handled by
next.js/packages/next/server/base-server.ts
Line 370 in 0f7f332
setLazyProp({ req: req as any }, 'cookies', getCookieParser(req.headers)) |
this.sendResolve = resolve | ||
}) | ||
private sendResolve?: () => void | ||
private response = this.sendPromise.then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will behave same as Node response. This promise will resolve when send
is called with a Response object that has the headers/status at that moment, but the body will still be able to be streamed.
To match 100%, we could add a call to send
within the transform stream when the first write happens, but since we'll only be using streams in render.tsx
we can just call send
there manually for simplicity
Closing in favor of #32999 |
Bug
fixes #number
contributing.md
Feature
fixes #number
contributing.md
Documentation / Examples
yarn lint