diff --git a/tests/net/request/user_agent.luau b/tests/net/request/user_agent.luau new file mode 100644 index 00000000..04491b7e --- /dev/null +++ b/tests/net/request/user_agent.luau @@ -0,0 +1,9 @@ +local net = require("@lune/net") + +local runtime, version = table.unpack(_VERSION:split(" ")) +local expectedUserAgent = runtime:lower() .. "/" .. version + +local userAgent: string = + net.jsonDecode(net.request("https://www.whatsmyua.info/api/v1/ua").body)[1].ua.rawUa + +assert(userAgent == expectedUserAgent, "Expected user agent to be " .. expectedUserAgent)