Skip to content

net/http: make CrossOriginProtection zero value work [freeze exception] #74089

Closed
@aclements

Description

@aclements

In #73626, we overlooked specifying the zero value of the new net/http.CrossOriginProtection type. As implemented, attempting to use the zero value will result in most of its methods panicking with a nil dereference.

We'd like a freeze exception to make the zero value of CrossOriginProtection work just like the value currently returned by NewCrossOriginProtection().

There was some discussion of this when the CL was written, but it focused on whether NewCrossOriginProtection was necessary and concluded that it made certain patterns much nicer to write, but that discussion overlooked that we could also make the zero value work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a tool

    Type

    No type

    Projects

    Status

    Approved

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions