-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue for Android Marshmallow and below - Url path has to be ma…
…nually encoded
- Loading branch information
1 parent
122ab24
commit 1bb039f
Showing
5 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/androidTest/java/eu/zderadicka/audioserve/UriEncodingTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package eu.zderadicka.audioserve | ||
|
||
import android.os.Build | ||
import eu.zderadicka.audioserve.utils.encodeUri | ||
import org.junit.Test | ||
import org.junit.Assert.* | ||
|
||
class UriEncodingTest { | ||
@Test | ||
fun testEncoding() { | ||
val uriEncoded = "http://localhost:3000/folder/Doyle%2C%20Arthur%20Conan" | ||
val uriWithSpace = "http://localhost:3000/folder/Doyle, Arthur Conan" | ||
val res = encodeUri(uriWithSpace) | ||
if (Build.VERSION.SDK_INT<= 23) { | ||
|
||
assertEquals(uriEncoded, res) | ||
} else { | ||
assertEquals(uriWithSpace, res) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters