
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
-- import "vimagination.zapto.org/httplog"
Package httplog is used to create wrappers around http.Handler's to gather information about a request and its response.
const DefaultFormat = "{{.RemoteAddr}} - {{.URL.User.Username}} - [{{.StartTime.Format \"02/01/2006:15:04:05 +0700\"}}] \"{{.Method}} {{.URL.RequestURI}} {{.Proto}}\" {{.Status}} {{.RequestLength}} {{.StartTime.Sub .EndTime}}"
DefaultFormat is a simple template to output log data in something reminiscent on the Apache default format.
func Wrap(m http.Handler, l Logger) http.Handler
Wrap wraps an existing http.Handler and collects data about the request and response and passes it to a logger.
type Details struct {
*http.Request
Status, ResponseLength int
StartTime, EndTime time.Time
}
Details is a collection of data about the request and response.
type Logger interface {
Log(d Details)
}
Logger allows clients to specify how collected data is handled.
func NewWriteLogger(w io.Writer, format string) (Logger, error)
NewWriteLogger uses the given format as a template to write log data to the given io.Writer.
type WriteLogger struct {
}
WriteLogger is a Logger which formats log data to a given template and writes it to a given io.Writer.
func (w *WriteLogger) Log(d Details)
Log satisfies the Logger interface.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.