-
Notifications
You must be signed in to change notification settings - Fork 154
Closed
Labels
Description
The recommended way to translate a segment of text is
string entity = HttpContext.ParseAndTranslate("Hi - [[[Sign in]]]");
However it does a bit more that just translate the text, it try to setup headers as a side effect.
It make a call to ProcessOutgoing which aim to rewrite url consistently with url localisation scheme. BUT that method also try to rewrite url in headers
Possible problem of those hidden side effect include error when there are no http response. (for example sending email at scheduled time)
System.PlatformNotSupportedException: This operation requires IIS integrated pipeline mode.
at System.Web.HttpResponse.get_Headers()
at System.Web.HttpResponseWrapper.get_Headers()
at i18n.EarlyUrlLocalizer.ProcessOutgoing(String entity, String langtag, HttpContextBase context)
at i18n.HttpContextExtensions.ParseAndTranslate(HttpContextBase context, String entity
Possible solution include splitting ProcessOutgoing
as ProcessOutgoingNuggets
and ProcessOutgoingHeaders
. Then call header localization only when filtering request.