1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-04 17:16:20 +00:00

Fix pastebin.lua not using HTTPS

Attempting to use pastebin with plain HTTP results in a 301 redirect to the HTTPS version. This PR (and associated commit) makes the pastebin command work again.
This commit is contained in:
MineRobber___T 2017-07-06 03:58:41 -04:00 committed by GitHub
parent 1d63598d43
commit f0559867d0

View File

@ -21,7 +21,7 @@ end
local function get(paste) local function get(paste)
write( "Connecting to pastebin.com... " ) write( "Connecting to pastebin.com... " )
local response = http.get( local response = http.get(
"http://pastebin.com/raw/"..textutils.urlEncode( paste ) "https://pastebin.com/raw/"..textutils.urlEncode( paste )
) )
if response then if response then
@ -56,7 +56,7 @@ if sCommand == "put" then
write( "Connecting to pastebin.com... " ) write( "Connecting to pastebin.com... " )
local key = "0ec2eb25b6166c0c27a394ae118ad829" local key = "0ec2eb25b6166c0c27a394ae118ad829"
local response = http.post( local response = http.post(
"http://pastebin.com/api/api_post.php", "https://pastebin.com/api/api_post.php",
"api_option=paste&".. "api_option=paste&"..
"api_dev_key="..key.."&".. "api_dev_key="..key.."&"..
"api_paste_format=lua&".. "api_paste_format=lua&"..