Skip to content

Commit c0f2112

Browse files
github-actions[bot]Wires77LocalIdentity
authored
Fix URL spoofing issue with imported URLs (#1792)
* Apply changes from PathOfBuildingCommunity/PathOfBuilding#9754 * Fix conflicts --------- Co-authored-by: Wires77 <Wires77@users.noreply.github.com> Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 9e3c379 commit c0f2112

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/Modules/BuildSiteTools.lua

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,36 @@
77
buildSites = { }
88

99
-- Import/Export websites list used in dropdowns
10+
-- label: What a user sees in the export dropdown and when the import box recognizes the website
11+
-- id: Protocol handler id used to load builds with the pob: URL scheme e.g. pob://Maxroll/siteSpecificBuildId
12+
-- matchURL: A pattern to match URLs belonging to this website to show a valid url message in ImportTab
13+
-- regexURL: Copied link from website to extract the build ID and pass to downloadURL to get the raw build XML
14+
-- downloadURL: The URL to download the raw build code
15+
-- codeOut: Gets prepended to returned code from postUrl. Needed to enable export in ImportTab
16+
-- postUrl: The URL to upload a build code. Needed to enable export in ImportTab
17+
-- postFields: The POST fields prepended to base64-encoded XML. Needed to enable export in ImportTab
18+
-- linkURL: The URL pattern to link to the provided build code (Unused currently)
1019
buildSites.websiteList = {
1120
{
12-
label = "Maxroll", id = "Maxroll", matchURL = "maxroll%.gg/poe2/pob/.*", regexURL = "maxroll%.gg/poe2/pob/(.+)%s*$", downloadURL = "maxroll%.gg/poe2/api/pob/%1",
21+
label = "Maxroll", id = "Maxroll", matchURL = "^https:/maxroll%.gg/poe2/pob/.*", regexURL = "maxroll%.gg/poe2/pob/(.+)%s*$", downloadURL = "maxroll%.gg/poe2/api/pob/%1",
1322
codeOut = "https://maxroll.gg/poe2/pob/", postUrl = "https://maxroll.gg/poe2/api/pob", postFields = "pobCode=", linkURL = "maxroll%.gg/poe2/pob/%1"
1423
},
1524
{
16-
label = "pobb.in", id = "POBBin", matchURL = "pobb%.in/.+", regexURL = "pobb%.in/(.+)%s*$", downloadURL = "pobb.in/pob/%1",
25+
label = "pobb.in", id = "POBBin", matchURL = "^https:/pobb%.in/.+", regexURL = "pobb%.in/(.+)%s*$", downloadURL = "pobb.in/pob/%1",
1726
codeOut = "https://pobb.in/", postUrl = "https://pobb.in/pob/", postFields = "", linkURL = "pobb.in/%1"
1827
},
1928
{
20-
label = "poe.ninja", id = "PoeNinja", matchURL = "poe2?%.ninja/?p?o?e?2?/pob/.+", regexURL = "poe2?%.ninja/?p?o?e?2?/pob/(.+)%s*$", downloadURL = "poe.ninja/poe2/pob/raw/%1",
29+
label = "poe.ninja", id = "PoeNinja", matchURL = "^https:/poe2?%.ninja/?p?o?e?2?/pob/.+", regexURL = "poe2?%.ninja/?p?o?e?2?/pob/(.+)%s*$", downloadURL = "poe.ninja/poe2/pob/raw/%1",
2130
codeOut = "", postUrl = "https://poe.ninja/poe2/pob/api/upload", postFields = "code=", linkURL="poe.ninja/poe2/pob/%1"
2231
},
2332
{
24-
label = "poe2db.tw", id = "PoE2DB", matchURL = "poe2db%.tw/pob/.+", regexURL = "poe2db%.tw/pob/(.+)%s*$", downloadURL = "poe2db.tw/pob/%1/raw",
33+
label = "poe2db.tw", id = "PoE2DB", matchURL = "^https:/poe2db%.tw/pob/.+", regexURL = "poe2db%.tw/pob/(.+)%s*$", downloadURL = "poe2db.tw/pob/%1/raw",
2534
codeOut = "", postUrl = "https://poe2db.tw/pob/api/gen", postFields = "", linkURL = "poe2db.tw/pob/%1"
2635
},
2736
{
28-
label = "Pastebin.com", id = "pastebin", matchURL = "pastebin%.com/%w+", regexURL = "pastebin%.com/(%w+)%s*$", downloadURL = "pastebin.com/raw/%1", linkURL = "pastebin.com/%1"
37+
label = "Pastebin.com", id = "pastebin", matchURL = "^https:/pastebin%.com/%w+", regexURL = "pastebin%.com/(%w+)%s*$", downloadURL = "pastebin.com/raw/%1", linkURL = "pastebin.com/%1"
2938
},
30-
{ label = "PastebinP.com", id = "pastebinProxy", matchURL = "pastebinp%.com/%w+", regexURL = "pastebinp%.com/(%w+)%s*$", downloadURL = "pastebinp.com/raw/%1", linkURL = "pastebin.com/%1" },
39+
{ label = "PastebinP.com", id = "pastebinProxy", matchURL = "^https:/pastebinp%.com/%w+", regexURL = "pastebinp%.com/(%w+)%s*$", downloadURL = "pastebinp.com/raw/%1", linkURL = "pastebin.com/%1" },
3140
{ label = "Rentry.co", id = "rentry", matchURL = "rentry%.co/%w+", regexURL = "rentry%.co/(%w+)%s*$", downloadURL = "rentry.co/paste/%1/raw", linkURL = "rentry.co/%1" },
3241
}
3342

0 commit comments

Comments
 (0)