From 9e642248fe05018fdd428f7c94944581237a10e4 Mon Sep 17 00:00:00 2001 From: sandtechnology Date: Sun, 13 Jun 2021 19:34:43 +0800 Subject: [PATCH 1/3] Remove lucko helper lib --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index c05729b63..5a74557f1 100644 --- a/pom.xml +++ b/pom.xml @@ -869,12 +869,6 @@ commons-codec 1.15 - - me.lucko - helper - 5.6.5 - provided - org.slf4j From 136b7fc09b879b069a3f5cf4deaa9a2c17370c61 Mon Sep 17 00:00:00 2001 From: sandtechnology Date: Sun, 13 Jun 2021 19:40:10 +0800 Subject: [PATCH 2/3] Add user agent in LuckoPastebinPaster --- .../org/maxgamer/quickshop/util/paste/LuckoPastebinPaster.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/maxgamer/quickshop/util/paste/LuckoPastebinPaster.java b/src/main/java/org/maxgamer/quickshop/util/paste/LuckoPastebinPaster.java index ffedeea6b..5f0da8ba5 100644 --- a/src/main/java/org/maxgamer/quickshop/util/paste/LuckoPastebinPaster.java +++ b/src/main/java/org/maxgamer/quickshop/util/paste/LuckoPastebinPaster.java @@ -40,6 +40,7 @@ public class LuckoPastebinPaster implements PasteInterface { public String pasteTheText(@NotNull String text) throws IOException { HttpRequest request = HttpRequest.post(new URL("https://bytebin.lucko.me/post")) .body(text) + .header("User-Agent", "QuickShop-Reremake") .execute(); request.expectResponseCode(200, 201, 301, 302); String json = request.returnContent().asString("UTF-8"); From ef1d3d200bacf533a12987567739da64d8f56d10 Mon Sep 17 00:00:00 2001 From: sandtechnology Date: Sun, 13 Jun 2021 19:42:34 +0800 Subject: [PATCH 3/3] Making LuckoPastebinPaster to the end --- .../org/maxgamer/quickshop/util/paste/Paste.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/util/paste/Paste.java b/src/main/java/org/maxgamer/quickshop/util/paste/Paste.java index dafc50288..4c8cabdfd 100644 --- a/src/main/java/org/maxgamer/quickshop/util/paste/Paste.java +++ b/src/main/java/org/maxgamer/quickshop/util/paste/Paste.java @@ -480,19 +480,12 @@ public class Paste { public String paste(@NotNull String content) { PasteInterface paster; try { - // EngineHub Pastebin + // Pastebin paster = new PastebinPaster(); return paster.pasteTheText(content); } catch (Exception ex) { Util.debugLog(ex.getMessage()); } - try { - // Lucko Pastebin - paster = new LuckoPastebinPaster(); - return paster.pasteTheText(content); - } catch (Exception ex) { - Util.debugLog(ex.getMessage()); - } try { // Ubuntu Pastebin paster = new UbuntuPaster(); @@ -500,6 +493,13 @@ public class Paste { } catch (Exception ex) { Util.debugLog(ex.getMessage()); } + try { + // Lucko Pastebin + paster = new LuckoPastebinPaster(); + return paster.pasteTheText(content); + } catch (Exception ex) { + Util.debugLog(ex.getMessage()); + } return null; }