@@ -60,7 +60,7 @@ namespace {{ spec.title | caseUcfirst }}
60
60
{
61
61
_endpoint = endpoint;
62
62
_http = http ?? new HttpClient();
63
-
63
+
64
64
_httpForRedirect = httpForRedirect ?? new HttpClient(
65
65
new HttpClientHandler(){
66
66
AllowAutoRedirect = false
@@ -220,7 +220,7 @@ namespace {{ spec.title | caseUcfirst }}
220
220
221
221
public async Task<String > Redirect(
222
222
string method,
223
- string path,
223
+ string path,
224
224
Dictionary<string , string > headers,
225
225
Dictionary<string , object ?> parameters)
226
226
{
@@ -269,7 +269,7 @@ namespace {{ spec.title | caseUcfirst }}
269
269
var response = await _http.SendAsync(request);
270
270
var code = (int)response.StatusCode;
271
271
272
- if (response.Headers.TryGetValues("x-{{ spec .title | lower }}-warning", out var warnings))
272
+ if (response.Headers.TryGetValues("x-{{ spec .title | lower }}-warning", out var warnings))
273
273
{
274
274
foreach (var warning in warnings)
275
275
{
@@ -376,16 +376,23 @@ namespace {{ spec.title | caseUcfirst }}
376
376
377
377
if (!string.IsNullOrEmpty(idParamName) && (string)parameters[idParamName] != "unique()")
378
378
{
379
+ try
380
+ {
379
381
// Make a request to check if a file already exists
380
382
var current = await Call<Dictionary <string , object ?>>(
381
383
method: "GET",
382
- path: "$ path/${params [idParamName]}",
383
- headers ,
384
- parameters = new Dictionary<string , object ?>()
384
+ path: $"{ path}/{parameters [idParamName]}",
385
+ new Dictionary< string , string > { { "content-type", "application/json" } } ,
386
+ parameters: new Dictionary<string , object ?>()
385
387
);
386
388
var chunksUploaded = (long)current["chunksUploaded"];
387
389
offset = chunksUploaded * ChunkSize;
388
390
}
391
+ catch (Exception ex)
392
+ {
393
+ // ignored as it mostly means file not found
394
+ }
395
+ }
389
396
390
397
while (offset < size)
391
398
{
0 commit comments