cgi

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

A lot of this code is copied straight from the Go standard library: https://golang.org/src/net/http/cgi/host.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Path string
	Root string

	Name string // value to use for SERVER_SOFTWARE env var
	Port string

	Dir string

	InheritEnv []string
	Logger     *log.Logger
	Args       []string
	Stderr     io.Writer

	// Header contains header values that should be used by default.
	// If the client CGI process writes a header to its stdout thats already in Header, it will be replaced.
	Header http.Header
	// Don't replace header values in Header by those output by the CGI client process.
	ReplaceHeader bool
}

Handler runs an executable in a subprocess with an almost CGI environment. The executable does not need to provide any headers, Handler will provide default Header values. If the executable does provide header values, they will overwrite the default values in Header. Currently ignored headers: "Location"

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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