libhttp

package
v0.0.0-...-c980814 Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package libhttp provides http related library functions.

Index

Constants

This section is empty.

Variables

View Source
var BasicRealm = "Authorization Required"

BasicRealm is used when setting the WWW-Authenticate response header.

Functions

func BasicAuthUnauthorized

func BasicAuthUnauthorized(w http.ResponseWriter, err error)

BasicAuthUnauthorized denies authentication.

func HandleErrorJson

func HandleErrorJson(w http.ResponseWriter, err error)

HandleErrorJson wraps error in JSON structure.

func ParseBasicAuth

func ParseBasicAuth(auth string) (username, password string, ok bool)

ParseBasicAuth parses an HTTP Basic Authentication string. "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" returns ("Aladdin", "open sesame", true).

Types

This section is empty.

Jump to

Keyboard shortcuts

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