Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose request protocol in request object in jsvm #1702

Merged
merged 1 commit into from
May 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mw_js_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type MiniRequestObject struct {
IgnoreBody bool
Method string
RequestURI string
Proto string
}

type VMReturnObject struct {
Expand Down Expand Up @@ -96,7 +97,6 @@ func (d *DynamicMiddleware) ProcessRequest(w http.ResponseWriter, r *http.Reques
}).Error("Failed to read request body! ", err)
return nil, 200
}

headers := r.Header
host := r.Host
if host == "" && r.URL != nil {
Expand All @@ -122,6 +122,7 @@ func (d *DynamicMiddleware) ProcessRequest(w http.ResponseWriter, r *http.Reques
DeleteParams: []string{},
Method: r.Method,
RequestURI: r.RequestURI,
Proto: r.Proto,
}

requestAsJson, err := json.Marshal(requestData)
Expand Down