diff --git a/wrp.go b/wrp.go index 826e6fb..b4b64a9 100644 --- a/wrp.go +++ b/wrp.go @@ -83,30 +83,35 @@ func pageServer(out http.ResponseWriter, req *http.Request) { if s < 0.1 { s = 1.0 } + c, _ := strconv.ParseInt(req.FormValue("c"), 10, 64) + if c < 2 || c > 256 { + c = 256 + } log.Printf("%s Page Reqest for url=\"%s\" [%s]\n", req.RemoteAddr, u, req.URL.Path) out.Header().Set("Content-Type", "text/html") fmt.Fprintf(out, "\n", version) fmt.Fprintf(out, "\n
\n") if len(u) > 4 { if strings.HasPrefix(u, "http") { - capture(u, w, h, s, p, i, req.RemoteAddr, out) + capture(u, w, h, s, int(c), p, i, req.RemoteAddr, out) } else { - capture(fmt.Sprintf("http://www.google.com/search?q=%s", url.QueryEscape(u)), w, h, s, p, i, req.RemoteAddr, out) + capture(fmt.Sprintf("http://www.google.com/search?q=%s", url.QueryEscape(u)), w, h, s, int(c), p, i, req.RemoteAddr, out) } } else { fmt.Fprintf(out, "No URL or search query specified") } - fmt.Fprintf(out, "\n
Web Rendering Proxy Version %s\n\n", w, h, s, ion, version) + fmt.Fprintf(out, "\n