Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Save the original request function
- local original_request = request or http_request or syn.request
- -- Create new request function with custom user-agent
- getgenv().request = function(options)
- -- Add/modify user-agent header
- if options.Headers then
- options.Headers["User-Agent"] = "MyCustomAgent/1.0 (Roblox)"
- else
- options.Headers = {
- ["User-Agent"] = "MyCustomAgent/1.0 (Roblox)"
- }
- end
- -- Call original request function
- return original_request(options)
- end
- -- Optional: Also modify HttpGet if needed
- getgenv().HttpGet = function(url, decode)
- return request({
- Url = url,
- Method = "GET"
- }).Body
- end
Advertisement
Add Comment
Please, Sign In to add comment