Add URL scheme param to run-server
Enables running proxy server against local Gerrit one like this: ./polygerrit-ui/run-server.sh --host=localhost:8080 --scheme=http Change-Id: Ie35b11879751b1bb2d353d5a5849e4dfe443c4b3
This commit is contained in:
parent
82ef5ed510
commit
501e013f9d
@ -32,6 +32,7 @@ var (
|
||||
restHost = flag.String("host", "gerrit-review.googlesource.com", "Host to proxy requests to")
|
||||
port = flag.String("port", ":8081", "Port to serve HTTP requests on")
|
||||
prod = flag.Bool("prod", false, "Serve production assets")
|
||||
scheme = flag.String("scheme", "https", "URL scheme")
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -57,7 +58,7 @@ func handleRESTProxy(w http.ResponseWriter, r *http.Request) {
|
||||
req := &http.Request{
|
||||
Method: "GET",
|
||||
URL: &url.URL{
|
||||
Scheme: "https",
|
||||
Scheme: *scheme,
|
||||
Host: *restHost,
|
||||
Opaque: r.URL.EscapedPath(),
|
||||
RawQuery: r.URL.RawQuery,
|
||||
|
Loading…
Reference in New Issue
Block a user