MCPcopy Create free account
hub / github.com/tebeka/selenium / handler

Function handler

remote_test.go:2076–2104  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

2074`
2075
2076func handler(w http.ResponseWriter, r *http.Request) {
2077 path := r.URL.Path
2078 page, ok := map[string]string{
2079 "/": homePage,
2080 "/other": otherPage,
2081 "/search": searchPage,
2082 "/log": logPage,
2083 "/frame": framePage,
2084 "/title": titleChangePage,
2085 "/alert": alertPage,
2086 }[path]
2087 if !ok {
2088 http.NotFound(w, r)
2089 return
2090 }
2091
2092 if path == "/search" {
2093 r.ParseForm()
2094 page = fmt.Sprintf(page, r.Form["q"][0], r.Form["s"][0])
2095 }
2096 // Some cookies for the tests
2097 for i := 0; i < 3; i++ {
2098 http.SetCookie(w, &http.Cookie{
2099 Name: fmt.Sprintf("cookie-%d", i),
2100 Value: fmt.Sprintf("value-%d", i),
2101 })
2102 }
2103 fmt.Fprintf(w, page)
2104}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…