Skip to content

Clarify behaviour for container managed HTTP headers #673

@markt-asf

Description

@markt-asf

Taking Greg's text from #672 that adds support for early hints.

I understand that this method doesn't change the response headers, but we have other methods that will ultimately change the response headers, but we have not specified when, as it previously made little difference if they were set when called or when committed.

For example, if setLocale(Locale) has been called, would we expect to see a Content-Type header? Will content-length be sent if set by the application? probably Yes? Will content-length be set if the server can guess at it (e.g. some content aggregated in the buffer). Probably No?

We also have other container managed headers such as Date, Server and maybe X-Powered. Are these fields populated in the response prior to dispatch, and thus visible in response.getHeader() and would be sent with earlyHints, or are they set on commit?

Currently Jetty is modelling fields such as Date and Server as persistent fields. They are added to the response pre-dispatch, so they can be seen by the application. Their values can be changed if the application wishes, but they cannot be removed (as sending Date is MUST element in the RFC). So should these would be included in the 103 early hints? I don't see why not, but then I don't see any examples doing so.

I think we have been deliberately vague about server managed headers vs application managed headers. Maybe we need to be a bit less vague now? Or at least have language here that allows for the different possible implementations of server managed headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions