Try our conversational search powered by Generative AI!

CMS 12 - API V3 - Invalid non-ASCII or control character in header: 0x2212

Vote:
 

Reposting this in correct room and description

Invalid non-ASCII or control character in header: 0x2212"

If you have multi-culture enabled and query delivery api in 'nb-no' culture whereas no issues for any other culture so far - but possibly could happen for other cultures i've only tried from a list of few

/api/episerver/v3.0/content/?contenturl=/nb-no/page-url/&expand=*

I started investigating this bit by bit and in the end it turns out the problem was coming from [OutputCacheFilterAttribute] when it tries to add etag hash-code (ETag hash contains non-ascii characters) in header like

 typedHeaders.ETag = new EntityTagHeaderValue((StringSegment)("\"" + evaluateResult.ETag + "\""));

These are all private/seal classes methods so nothing much you can do to control it - any chance it can be base64 encoded before adding to header as .net 5 as of now does not seem to support non-ascii characters in header

Or any chance api can provide some options to control/disable etag generation? There is a ContentETagGenerator available but OutputCacheFilterAttribute re-generate hash again within its private methods.

Many thanks,

Kashif

#266981
Edited, Nov 18, 2021 18:56
Vote:
 

Are you using the released version of Content Delivery? This a known bug that should've been fixed.

#267027
Nov 19, 2021 8:41
Vote:
 

Hi Johan, yes using v3.0.0 which I believe is the latest as of now.

#267038
Nov 19, 2021 11:20
Vote:
 

I have the same issue with v3.0.0.

#268107
Dec 09, 2021 9:54
Vote:
 

The fix ended up in 3.0.1 and will hopfully be released early next week.

#268108
Dec 09, 2021 10:20
Vote:
 

Hi Johan! Any update on v 3.0.1?

#269805
Jan 11, 2022 9:50
Vote:
 

3.0.1 is published now. 

#269884
Jan 12, 2022 13:46
Vote:
 

Thank you! Issue resolved. :)

#269937
Jan 13, 2022 10:39
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.