cors

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	plugin.Plugin
	// contains filtered or unexported fields
}

Plugin adds CORS: OPTIONS preflight is answered in the HTTP middleware; other responses are decorated in Plugin.OnResponse.

func New

func New() *Plugin

New creates a CORS plugin.

func (*Plugin) OnRequest

func (p *Plugin) OnRequest(_ *zoox.Context, _ *http.Request) error

func (*Plugin) OnResponse

func (p *Plugin) OnResponse(ctx *zoox.Context, res *http.Response) error

OnResponse sets CORS headers on the upstream response.

func (*Plugin) Prepare

func (p *Plugin) Prepare(app *zoox.Application, cfg *config.Config) error

Prepare validates configuration and registers middleware.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL