Comments (6)
Hi Kim,
Let me take a look and probably setup the HttpListener thread with en-US
culture to avoid force it from outside.
Thank you
On Fri, Nov 27, 2015 at 1:21 AM, Sunghun Kim [email protected]
wrote:
I got ArgumentException with any http request, the stack trace is:
2015-11-27 16:08:16.704 System.ArgumentException: 지정한 값에 잘못된 제어 문자가 있습니다.
매개 변수 이름: value
위치: System.Net.WebHeaderCollection.CheckBadChars(String name, Boolean
isHeaderValue)
위치: System.Net.WebHeaderCollection.SetInternal(String name, String value)
위치: Unosquare.Labs.EmbedIO.Extensions.NoCache(HttpListenerContext context)
위치: Unosquare.Labs.EmbedIO.Modules.WebApiModule.<.ctor>b__2_0(WebServer
server, HttpListenerContext context)
위치: Unosquare.Labs.EmbedIO.WebServer.ProcessRequest(HttpListenerContext
context)The cause is
context.Response.AddHeader(Constants.HeaderLastModified, DateTime.UtcNow.ToString(Constants.BrowserTimeFormat));
in Extensions.NoCache() method.
With Korean locale, ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'") generates
non-ASCII characters.
The token "ddd" is the problem.Workaround: change the locale on program startup, like
var culture = CultureInfo.CreateSpecificCulture("en-US");
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;I wish this problem is fixed for non-english users in the world~ :)
—
Reply to this email directly or view it on GitHub
#24.
Geo Pérez
from embedio.
@shkim quick question, what .NET version are you using?
from embedio.
Windows 8.1 / Visual Studio 2013 / .NET Framework 4.5.1
from embedio.
My suggestion is to generate the Browser Time Format manually as opposed to using a format string. The days of the week and the names of every month will need to be specified by a hard-coded dictionary using DateTime.DayOfWeek and DateTime.Month respectively as keys to what the browser expects.
from embedio.
I have updated the code to use en-US culture when generating these headers. Hope this fixes the issue.
from embedio.
@geoperez maybe add a unit test that creates a web server under a thread with a different culture and check if it generates the browser time format the right way.
Closing issue as not further comment were provided by @shkim
from embedio.
Related Issues (20)
- Cannot control charset in ContentType header HOT 3
- How to send statuscode 202 HOT 1
- EmbedIO 3.5.0 NuGet package references wrong/old version of Unosquare.Swan.Lite HOT 22
- System.ObjectDisposedException when processing multiple requests at once HOT 2
- WithZipFile should open a read only handle(or have the option to) HOT 2
- FileModule or StaticFolderModule get stuck returning medium files HOT 4
- Add XML as response type
- EmbedIO Dual-Stack Localhost Listener Causes Empty Replies HOT 1
- How can I custom the Server header HOT 2
- Disable request logging only
- Cookies issue
- EmbedIO.Samples console app does not work when PublishAot is set to true HOT 2
- Web Server does not work in Xamarin.iOS (IOS-17) HOT 3
- How to report progess via api - event-stream
- HttpContext.OnClose not firing HOT 1
- Getting rid of double quotes around strings in a Web API response (turning off JSON serialization) HOT 1
- Issue Serving Static Folder Xamarin ( 3.5.2) Forms on Android
- Request.Url mixing up http and https
- server stop responding after some time HOT 4
- The return array is empty. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embedio.