Skip to content

Support custom HTTP Status Code for Server Components #53225

Answered by timneutkens
devjiwonchoi asked this question in Help
Discussion options

You must be logged in to vote

While I understand the request. It seems there is a misunderstanding about when streaming starts and how that relates to the status code and your code. This proposal can't work because of limitations with streaming, specifically you can't set the status code after the headers have been sent and the stream has started.

At the point where the Profile component in the example runs the headers have already been sent and the stream has been started. This means that you can't change the status code / headers at that point. What we do for notFound() / redirect() when they are called when the stream has started is adding meta tags recommended by Google for these cases.

TLDR: because of streaming …

Replies: 24 comments 43 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
11 replies
@leerob
Comment options

@astateful
Comment options

@DennieMello
Comment options

@DennieMello
Comment options

@lauriskuznecovs
Comment options

Answer selected by leerob
Comment options

You must be logged in to vote
1 reply
@mthmcalixto
Comment options

Comment options

You must be logged in to vote
2 replies
@ludwighogstrom
Comment options

@JurajKavka
Comment options

Comment options

You must be logged in to vote
9 replies
@JurajKavka
Comment options

@gnoff
Comment options

@JurajKavka
Comment options

@traviswimer
Comment options

@JurajKavka
Comment options

Comment options

You must be logged in to vote
3 replies
@v1adko
Comment options

@v1adko
Comment options

@cnunciato
Comment options

This comment was marked as spam.

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ddehen
Comment options

@suleymangezsat
Comment options

Comment options

You must be logged in to vote
3 replies
@JurajKavka
Comment options

@devjiwonchoi
Comment options

@traviswimer
Comment options

Comment options

You must be logged in to vote
1 reply
@dpnolte
Comment options

Comment options

You must be logged in to vote
1 reply
@v1adko
Comment options

Comment options

You must be logged in to vote
2 replies
@vks-brussell
Comment options

@v1adko
Comment options

Comment options

You must be logged in to vote
1 reply
@astateful
Comment options

Comment options

You must be logged in to vote
1 reply
@devjiwonchoi
Comment options

Comment options

You must be logged in to vote
2 replies
@alexleach
Comment options

@alexleach
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@quiloos39
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@JurajKavka
Comment options

@peleteiro
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@masadamsahid
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet