From e5d9ff71201ac8fcb8b1240c2c57004ff8753d93 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 22 Oct 2022 01:24:31 -0700 Subject: [PATCH] Fixed URL encoding --- .idea/misc.xml | 2 +- README.md | 2 +- build.gradle.kts | 8 ++++---- examples/build.gradle.kts | 2 +- src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt | 5 ++++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 95b6160..f5ea1de 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,7 +4,7 @@ - + diff --git a/README.md b/README.md index 767f37f..5adeef5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_isgd-shorten&metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_isgd-shorten) [![GitHub CI](https://github.com/ethauvin/isgd-shorten/actions/workflows/gradle.yml/badge.svg)](https://github.com/ethauvin/isgd-shorten/actions/workflows/gradle.yml) [![CircleCI](https://circleci.com/gh/ethauvin/isgd-shorten/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/isgd-shorten/tree/master) -# [is.gd](https://is.gd/developers.php) Shortener for Kotlin/Java/Android +# [is.gd](https://is.gd/developers.php) Shortener for Kotlin, Java & Android A simple implementation of the [is.gd API](https://is.gd/developers.php). diff --git a/build.gradle.kts b/build.gradle.kts index df6628c..4163178 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,14 +3,14 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { - id("com.github.ben-manes.versions") version "0.42.0" + id("com.github.ben-manes.versions") version "0.43.0" id("io.gitlab.arturbosch.detekt") version "1.21.0" id("java") id("java-library") id("maven-publish") id("net.thauvin.erik.gradle.semver") version "1.0.4" - id("org.jetbrains.dokka") version "1.7.10" - id("org.jetbrains.kotlinx.kover") version "0.6.0" + id("org.jetbrains.dokka") version "1.7.20" + id("org.jetbrains.kotlinx.kover") version "0.6.1" id("org.sonarqube") version "3.4.0.2513" id("signing") kotlin("jvm") version "1.7.20" @@ -18,7 +18,7 @@ plugins { } group = "net.thauvin.erik" -description = "is.gd Shortener for Kotlin/Java" +description = "is.gd Shortener for Kotlin, Java & Android" val gitHub = "ethauvin/$name" val mavenUrl = "https://github.com/$gitHub" diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index 2af7a7d..3e6f695 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("application") - id("com.github.ben-manes.versions") version "0.42.0" + id("com.github.ben-manes.versions") version "0.43.0" kotlin("jvm") version "1.7.20" } diff --git a/src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt b/src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt index 676f6f2..3d60ad8 100644 --- a/src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt +++ b/src/main/kotlin/net/thauvin/erik/isgd/Isgd.kt @@ -45,7 +45,10 @@ enum class Format(val type: String) { } fun String.encode(): String { - return URLEncoder.encode(this, StandardCharsets.UTF_8).replace("+", "%20").replace("*", "%2A").replace("%7E", "~") + return URLEncoder.encode(this, StandardCharsets.UTF_8) + .replace("+", "%20") + .replace("*", "%2A") + .replace("%7E", "~") } /**