Fixed URL encoding

This commit is contained in:
Erik C. Thauvin 2022-10-22 01:24:31 -07:00
parent 3a37899d0c
commit e5d9ff7120
5 changed files with 11 additions and 8 deletions

2
.idea/misc.xml generated
View file

@ -4,7 +4,7 @@
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="18" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" project-jdk-name="18" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View file

@ -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).

View file

@ -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"

View file

@ -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"
}

View file

@ -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", "~")
}
/**