Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
github.com/jeevatkm/middleware
A collection of HTTP middleware/Handler function for use with Go's net/http package. Compatible with Goji, Gorilla, Negroni & net/http (amongst many others).
go get github.com/jeevatkm/middleware
OR
go get gopkg.in/jeevatkm/middleware.v0
import "github.com/jeevatkm/middleware"
OR
import "gopkg.in/jeevatkm/middleware.v0"
Refer examples
func main() {
homeHandler := http.HandlerFunc(home)
// Adding Minify middleware
// Note: If you use any Gzip middleware, add Minify middleware after that
http.Handle("/", middleware.Minify(homeHandler))
log.Println("Starting server at localhost:8000")
http.ListenAndServe(":8000", nil)
}
func main() {
// Adding Minify middleware
// Note: If you use any Gzip middleware, add Minify middleware after that
goji.Use(middleware.Minify)
goji.Get("/", gojiHome)
goji.Serve()
}
func main() {
r := mux.NewRouter()
r.HandleFunc("/", gorillaHome)
// Adding Minify middleware
// Note: If you use any Gzip middleware, add Minify middleware after that
http.Handle("/", middleware.Minify(r))
log.Println("Starting server at localhost:8000")
http.ListenAndServe(":8000", nil)
}
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", negroniHome)
n := negroni.Classic()
// Adding Minify middleware
n.UseHandler(middleware.Minify(mux))
n.Run(":8000")
}
Middleware released under MIT License
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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.