Tests: Go application tests.
This commit is contained in:
19
test/go/cookies/app.go
Normal file
19
test/go/cookies/app.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"nginx/unit"
|
||||
)
|
||||
|
||||
func handler(w http.ResponseWriter, r *http.Request) {
|
||||
cookie1, _ := r.Cookie("var1")
|
||||
cookie2, _ := r.Cookie("var2")
|
||||
|
||||
w.Header().Set("X-Cookie-1", cookie1.Value)
|
||||
w.Header().Set("X-Cookie-2", cookie2.Value)
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", handler)
|
||||
unit.ListenAndServe(":7080", nil)
|
||||
}
|
||||
Reference in New Issue
Block a user