Skip to content

Commit

Permalink
Merge pull request #10 from FxllenCode/development
Browse files Browse the repository at this point in the history
1.1.9
  • Loading branch information
FxllenCode authored May 12, 2022
2 parents 4395cd6 + 70d9181 commit 4186ae7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To install via [Wally](https://wally.run), add the following to your `wally.toml

```toml
[dependencies]
roxios = "fxllencode/[email protected].8"
roxios = "fxllencode/[email protected].9"
```

Then, run `wally install` to install the dependencies.
Expand Down
17 changes: 14 additions & 3 deletions lib/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

local HttpService = game:GetService("HttpService")
local Promise = require(script.Parent.promise)
local URL = require(script.Parent.URL)

local module = {}

Expand Down Expand Up @@ -112,11 +113,21 @@ function module.RbxApiRequest(options: Options)
if options.Url == nil then
reject("Roxios error: No URL provided")
end
if string.find(options.Url, "roblox.com") == nil then
reject("Roxios error: URL is not a Roblox URL!")
local parsedURL = URL.parse(options.Url)

if parsedURL == nil and parsedURL.hostname == nil then
reject("Roxios error: Could not parse URL!")
end

if string.find(parsedURL.hostname, "roblox.com") == false or nil then
reject('Roxios error: URL is not a "*.roblox.com" domain!')
end

options.Url = string.gsub(options.Url, "roblox.com", "roproxy.com") -- why you shouldn't use this: https://devforum.roblox.com/t/psa-stop-using-roblox-proxies/1573256
parsedURL.hostname = string.gsub(parsedURL.hostname, "roblox.com", "roproxy.com") -- why you shouldn't use this: https://devforum.roblox.com/t/psa-stop-using-roblox-proxies/1573256
parsedURL.host = string.gsub(parsedURL.hostname, "roblox.com", "roproxy.com")
parsedURL.href = string.gsub(parsedURL.hostname, "roblox.com", "roproxy.com")
options.Url = URL.stringify(parsedURL)

local ok, response = pcall(HttpService.RequestAsync, HttpService, options)
if ok then
if response.Success then
Expand Down
5 changes: 3 additions & 2 deletions wally.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "fxllencode/roxios"
version = "1.1.8"
version = "1.1.9"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"

[dependencies]
promise = "evaera/[email protected]"
promise = "evaera/[email protected]"
URL = "csqrl/[email protected]"

0 comments on commit 4186ae7

Please sign in to comment.