diff options
| author | unwox <me@unwox.com> | 2024-08-23 21:14:30 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-08-23 21:14:30 +0600 |
| commit | 751e381230762caa6937e9c516de82fd27c59250 (patch) | |
| tree | 10a4ded95e673133d9e8303524a585469e805786 /main.go | |
| parent | 4003417f7b94648a7726995a49ab56c4bc8aad55 (diff) | |
pass a single response object instead of multiple arguments to lua
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -27,6 +27,7 @@ func main() { routeModule["route"] = func (l *Lua) int { fn := l.PopToRef() route := l.ToString(-1) + l.Pop(1) // find corresponding worker for the lua context var wrk *Worker for _, wrk = range wrks { @@ -111,13 +112,13 @@ func main() { // fixme: return error return 0 } - respHeaders := make(map[string]string) + respHeaders := make(map[string]any) for k := range resp.Header { respHeaders[k] = resp.Header.Get(k) } l.PushNumber(resp.StatusCode) - l.PushStringTable(respHeaders) + l.PushObject(respHeaders) l.PushString(string(respBody)) return 3 } |
