Skip to content

Commit 914cbf2

Browse files
Merge pull request #71 from appwrite/dev
fix: remove content-type from GET requests
2 parents bb6671d + b23d6bd commit 914cbf2

File tree

13 files changed

+31
-278
lines changed

13 files changed

+31
-278
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
@@ -38,7 +38,7 @@ repositories {
3838
Next, add the dependency to your project's `build.gradle(.kts)` file:
3939

4040
```groovy
41-
implementation("io.appwrite:sdk-for-android:7.0.0")
41+
implementation("io.appwrite:sdk-for-android:7.0.1")
4242
```
4343

4444
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
4949
<dependency>
5050
<groupId>io.appwrite</groupId>
5151
<artifactId>sdk-for-android</artifactId>
52-
<version>7.0.0</version>
52+
<version>7.0.1</version>
5353
</dependency>
5454
</dependencies>
5555
```

library/src/main/java/io/appwrite/Client.kt

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import java.io.BufferedReader
2525
import java.io.File
2626
import java.io.RandomAccessFile
2727
import java.io.IOException
28+
import java.lang.IllegalArgumentException
2829
import java.net.CookieManager
2930
import java.net.CookiePolicy
3031
import java.security.SecureRandom
@@ -86,7 +87,7 @@ class Client @JvmOverloads constructor(
8687
"x-sdk-name" to "Android",
8788
"x-sdk-platform" to "client",
8889
"x-sdk-language" to "android",
89-
"x-sdk-version" to "7.0.0",
90+
"x-sdk-version" to "7.0.1",
9091
"x-appwrite-response-format" to "1.6.0"
9192
)
9293
config = mutableMapOf()
@@ -211,24 +212,31 @@ class Client @JvmOverloads constructor(
211212
*
212213
* @return this
213214
*/
215+
@Throws(IllegalArgumentException::class)
214216
fun setEndpoint(endpoint: String): Client {
215-
this.endpoint = endpoint
216-
217-
if (this.endpointRealtime == null && endpoint.startsWith("http")) {
218-
this.endpointRealtime = endpoint.replaceFirst("http", "ws")
217+
require(endpoint.startsWith("http://") || endpoint.startsWith("https://")) {
218+
"Invalid endpoint URL: $endpoint"
219219
}
220220

221+
this.endpoint = endpoint
222+
this.endpointRealtime = endpoint.replaceFirst("http", "ws")
223+
221224
return this
222225
}
223226

224227
/**
225-
* Set realtime endpoint
226-
*
227-
* @param endpoint
228-
*
229-
* @return this
230-
*/
228+
* Set realtime endpoint
229+
*
230+
* @param endpoint
231+
*
232+
* @return this
233+
*/
234+
@Throws(IllegalArgumentException::class)
231235
fun setEndpointRealtime(endpoint: String): Client {
236+
require(endpoint.startsWith("ws://") || endpoint.startsWith("wss://")) {
237+
"Invalid realtime endpoint URL: $endpoint"
238+
}
239+
232240
this.endpointRealtime = endpoint
233241
return this
234242
}
@@ -525,7 +533,7 @@ class Client @JvmOverloads constructor(
525533
body
526534
)
527535
} else {
528-
AppwriteException(body, response.code)
536+
AppwriteException(body, response.code, "", body)
529537
}
530538
it.cancel(error)
531539
return

library/src/main/java/io/appwrite/enums/CreditCard.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ enum class CreditCard(val value: String) {
3434
@SerializedName("mir")
3535
MIR("mir"),
3636
@SerializedName("maestro")
37-
MAESTRO("maestro");
37+
MAESTRO("maestro"),
38+
@SerializedName("rupay")
39+
RUPAY("rupay");
3840

3941
override fun toString() = value
4042
}

library/src/main/java/io/appwrite/enums/OAuthProvider.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ enum class OAuthProvider(val value: String) {
3131
ETSY("etsy"),
3232
@SerializedName("facebook")
3333
FACEBOOK("facebook"),
34+
@SerializedName("figma")
35+
FIGMA("figma"),
3436
@SerializedName("github")
3537
GITHUB("github"),
3638
@SerializedName("gitlab")

0 commit comments

Comments
 (0)