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")
|
restHost = flag.String("host", "gerrit-review.googlesource.com", "Host to proxy requests to")
|
||||||
port = flag.String("port", ":8081", "Port to serve HTTP requests on")
|
port = flag.String("port", ":8081", "Port to serve HTTP requests on")
|
||||||
prod = flag.Bool("prod", false, "Serve production assets")
|
prod = flag.Bool("prod", false, "Serve production assets")
|
||||||
|
scheme = flag.String("scheme", "https", "URL scheme")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -57,7 +58,7 @@ func handleRESTProxy(w http.ResponseWriter, r *http.Request) {
|
|||||||
req := &http.Request{
|
req := &http.Request{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
URL: &url.URL{
|
URL: &url.URL{
|
||||||
Scheme: "https",
|
Scheme: *scheme,
|
||||||
Host: *restHost,
|
Host: *restHost,
|
||||||
Opaque: r.URL.EscapedPath(),
|
Opaque: r.URL.EscapedPath(),
|
||||||
RawQuery: r.URL.RawQuery,
|
RawQuery: r.URL.RawQuery,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user