mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
added env REQUEST_URL
This commit is contained in:
@@ -22,6 +22,7 @@ type Config struct {
|
||||
Route *models.Route
|
||||
Payload string
|
||||
Timeout time.Duration
|
||||
RequestURL string
|
||||
}
|
||||
|
||||
type Runner struct {
|
||||
|
||||
@@ -19,6 +19,7 @@ func (t *containerTask) Command() string { return "" }
|
||||
func (t *containerTask) EnvVars() map[string]string {
|
||||
env := map[string]string{
|
||||
"PAYLOAD": t.cfg.Payload,
|
||||
"REQUEST_URL": t.cfg.RequestURL,
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ func handleRunner(c *gin.Context) {
|
||||
Payload: string(payload),
|
||||
Timeout: 30 * time.Second,
|
||||
ID: reqID,
|
||||
RequestURL: c.Request.URL.String(),
|
||||
})
|
||||
|
||||
if err := run.Run(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user