Mercurial
comparison third_party/wrk/scripts/auth.lua @ 178:94705b5986b3
[ThirdParty] Added WRK and luajit for load testing.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Thu, 22 Jan 2026 20:10:30 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 177:24fe8ff94056 | 178:94705b5986b3 |
|---|---|
| 1 -- example script that demonstrates response handling and | |
| 2 -- retrieving an authentication token to set on all future | |
| 3 -- requests | |
| 4 | |
| 5 token = nil | |
| 6 path = "/authenticate" | |
| 7 | |
| 8 request = function() | |
| 9 return wrk.format("GET", path) | |
| 10 end | |
| 11 | |
| 12 response = function(status, headers, body) | |
| 13 if not token and status == 200 then | |
| 14 token = headers["X-Token"] | |
| 15 path = "/resource" | |
| 16 wrk.headers["X-Token"] = token | |
| 17 end | |
| 18 end |