Elfocrash / Cosmonaut

🌐 A supercharged Azure CosmosDB .NET SDK with ORM support
https://cosmonaut.readthedocs.io
MIT License
342 stars 44 forks source link

Pagination - Request headers must contain only ASCII characters #48

Closed jsneedles closed 5 years ago

jsneedles commented 5 years ago

Hi,

I am trying to use the continuation token approach to paginate... It works fine for a couple pages but then it fails with Request headers must contain only ASCII characters. -- in looking at the token, there are indeed non-ascii characters in the continuation token (people's names with accents).

Is there something I can do to transform the token to make it safe or is it something that can be fixed in Cosmonaut?

Thanks!

Elfocrash commented 5 years ago

Hey @jsneedles.

Can you please verify that this is a Cosmonaut specific issue and it's not an issue with the CosmosDB v2 SDK itself?

Cosmonaut is using the CosmosDB SDK behind the scenes and it's not doing any kind of transformation on the continuation token itself so I can't see how this is a Cosmonaut bug.

I could be wrong though so please verify the behaviour. Also, I assume you are providing the raw form of the continuation token and not a url encoded version.

There seems to be an issue raised in the CosmosDB sdk repo here: https://github.com/Azure/azure-cosmos-dotnet-v2/issues/552

jsneedles commented 5 years ago

👋 I think you're right... I just saw that issue on CosmosDB sdk repo as well.

For now I'm just going to do as they suggest and avoid ordering by names 😞

If you can implement any kind of workaround in Cosmonaut - that'd be pretty handy!

Thanks for checking.