@@ -81,7 +81,7 @@ internal CouchDatabase(IFlurlClient flurlClient, CouchOptions options, QueryCont
81
81
public async Task < TSource ? > FindAsync ( string docId , FindOptions options , CancellationToken cancellationToken = default )
82
82
{
83
83
IFlurlRequest request = NewRequest ( )
84
- . AppendPathSegment ( docId ) ;
84
+ . AppendPathSegment ( Uri . EscapeDataString ( docId ) ) ;
85
85
86
86
if ( options . Conflicts )
87
87
request = request . SetQueryParam ( "conflicts" , "true" ) ;
@@ -240,7 +240,7 @@ public async Task<TSource> AddOrUpdateAsync(TSource document, AddOrUpdateOptions
240
240
}
241
241
242
242
IFlurlRequest request = NewRequest ( )
243
- . AppendPathSegment ( document . Id ) ;
243
+ . AppendPathSegment ( Uri . EscapeDataString ( document . Id ) ) ;
244
244
245
245
if ( options . Batch )
246
246
request = request . SetQueryParam ( "batch" , "ok" ) ;
@@ -268,7 +268,7 @@ public async Task RemoveAsync(TSource document, bool batch = false, Cancellation
268
268
Check . NotNull ( document , nameof ( document ) ) ;
269
269
270
270
IFlurlRequest request = NewRequest ( )
271
- . AppendPathSegment ( document . Id ) ;
271
+ . AppendPathSegment ( Uri . EscapeDataString ( document . Id ) ) ;
272
272
273
273
if ( batch )
274
274
{
@@ -377,7 +377,7 @@ private async Task UpdateAttachments(TSource document, CancellationToken cancell
377
377
new FileStream ( attachment . FileInfo . FullName , FileMode . Open ) ) ;
378
378
379
379
AttachmentResult response = await NewRequest ( )
380
- . AppendPathSegment ( document . Id )
380
+ . AppendPathSegment ( Uri . EscapeDataString ( document . Id ) )
381
381
. AppendPathSegment ( Uri . EscapeUriString ( attachment . Name ) )
382
382
. WithHeader ( "Content-Type" , attachment . ContentType )
383
383
. WithHeader ( "If-Match" , document . Rev )
@@ -395,8 +395,8 @@ private async Task UpdateAttachments(TSource document, CancellationToken cancell
395
395
foreach ( CouchAttachment attachment in document . Attachments . GetDeletedAttachments ( ) )
396
396
{
397
397
AttachmentResult response = await NewRequest ( )
398
- . AppendPathSegment ( document . Id )
399
- . AppendPathSegment ( attachment . Name )
398
+ . AppendPathSegment ( Uri . EscapeDataString ( document . Id ) )
399
+ . AppendPathSegment ( Uri . EscapeDataString ( attachment . Name ) )
400
400
. WithHeader ( "If-Match" , document . Rev )
401
401
. DeleteAsync ( cancellationToken )
402
402
. ReceiveJson < AttachmentResult > ( )
@@ -664,7 +664,7 @@ public async Task<Stream> DownloadAttachmentAsStreamAsync(CouchAttachment attach
664
664
}
665
665
666
666
return await NewRequest ( )
667
- . AppendPathSegment ( attachment . DocumentId )
667
+ . AppendPathSegment ( Uri . EscapeDataString ( attachment . DocumentId ) )
668
668
. AppendPathSegment ( Uri . EscapeUriString ( attachment . Name ) )
669
669
. WithHeader ( "If-Match" , attachment . DocumentRev )
670
670
. GetStreamAsync ( cancellationToken )
0 commit comments