@@ -11,11 +11,11 @@ export class Client {
11
11
endpoint : string = 'https://cloud.appwrite.io/v1' ;
12
12
headers : Payload = {
13
13
'content-type' : '' ,
14
- 'user-agent' : `AppwriteDenoSDK/13 .0.0 (${ Deno . build . os } ; ${ Deno . build . arch } )` ,
14
+ 'user-agent' : `AppwriteDenoSDK/14 .0.0 (${ Deno . build . os } ; ${ Deno . build . arch } )` ,
15
15
'x-sdk-name' : 'Deno' ,
16
16
'x-sdk-platform' : 'server' ,
17
17
'x-sdk-language' : 'deno' ,
18
- 'x-sdk-version' : '13 .0.0' ,
18
+ 'x-sdk-version' : '14 .0.0' ,
19
19
'X-Appwrite-Response-Format' :'1.6.0' ,
20
20
} ;
21
21
@@ -113,8 +113,11 @@ export class Client {
113
113
* @return this
114
114
*/
115
115
setEndpoint ( endpoint : string ) : this {
116
- this . endpoint = endpoint ;
116
+ if ( ! endpoint . startsWith ( 'http://' ) && ! endpoint . startsWith ( 'https://' ) ) {
117
+ throw new AppwriteException ( 'Invalid endpoint URL: ' + endpoint ) ;
118
+ }
117
119
120
+ this . endpoint = endpoint ;
118
121
return this ;
119
122
}
120
123
@@ -180,7 +183,7 @@ export class Client {
180
183
} catch ( error ) {
181
184
throw new AppwriteException ( text , response . status , "" , text ) ;
182
185
}
183
- throw new AppwriteException ( json . message , json . code , json . type , json ) ;
186
+ throw new AppwriteException ( json . message , json . code , json . type , text ) ;
184
187
}
185
188
186
189
if ( responseType === "arraybuffer" ) {
0 commit comments