-
Notifications
You must be signed in to change notification settings - Fork 3k
406 Not Acceptable with version 0.2.13 #1610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have no idea what you're talking about |
Well, the template from templateUrl doesn't get loaded because of the above error which happens within angular.js (line 9734). this is my app.config
The same app works fine with 0.2.11 |
Please be specific, I can't possibly guess what your environment is doing. When UI-Router attempts to retrieve the template "src/app/home/home.html", then the HTTP server returns a HTTP 406 code? |
exactly |
sounds like your server is rejecting the HTTP request. As of 0.2.12 we are now requesting templates with an |
hm, could be, if that's the change then probably that's it, let me check it out |
Ok, it is the server configuration indeed. My server (IIS, IIS Express) is configured with this:
So we're removing the .html extension and readding it modified. This actually came from H5BP web.config for IIS. It started to work after commenting this out. It also works if I remove the charset specification in this rule. Now the only question remains, who's got this right? Your without charset specification or H5BP's that specifies it? |
Microsoft traditionally fucks up specifications, and we're not doing anything special with the charset. If this is a genuine problem for you, you can always compress your templates using any one of the available Angular toolsets to preload them into your page. Or, you can provide your own implementation of |
Wow, now this is what you call a sublime response. Or simply ignorant. I could reply with "there's OSS that traditionally doesn't give a fuck about i18n and there's OSS that actually cares about i18n". This has nothing to do with Microsoft, it is H5BP community proven web.config setting based on W3C recommendations (http://www.w3.org/International/O-HTTP-charset), which, I should say, worked without problems so far and this is the first time I ran into it, so it is ui-router that does something special. You might want to reconsider and set the accept header to something more sensible which "text/html; charset:utf-8" certainly is. Unless you don't give a fuck about international charsets. |
From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html:
Have a nice day. |
Except that this would create problems for Thai and Korean, and (I believe) one or two Japanese character sets, which Unicode doesn't cover. |
Where did you come up with that? UTF-8 covers everything and is regarded as the encoding of choice for HTML5 and whatnot. For sure you know that. By being multibyte encoding it can cover anything (Thai, Korean and Japanese are covered they just take more bytes to encode them). btw H5BP's configs for apache set it to text/html; charset: utf-8 too. Your objections start to sound more of a whim. |
The most important thing is, I configure my server to return HTML files encoded with a character set that supports a wider range of characters (UTF-8) and you want me to turn that back to the setting that has way less characters covered (ISO-8859-1, which is the default). And, by the way, using ui-router, can we even specify which charset should be used for XHR template loading? |
Not going to get involved in the flame war here, just want to add my two cents. I ran into the exact same issue thanks to web.config settings recommended by H5BP so thanks @brgrz for figuring that one out. I agree with @brgrz here as well that the charset should be sent since this seems to be the general recommendation out there. It's unlikely that the requested change will cause any problems for existing users, however, changing the header to one without a charset certainly does. |
I ran into this yesterday, I actually created a http interceptor that checked the url path for where our template html files live and modified the Accept header to I did try to set the accept header to "text/html; charset=UTF-8" but that caused IIS to keep returning 406's unclear why. using |
I also ran into this issue guys so thanks to everyone in the thread for their contribution, really helped me out. |
I put this inside my module's config:
|
This is also a problem in 0.2.18 |
I'm loading UI router from jsdelivr version 0.2.13 and I get 406 Not Acceptable on angular's
xhr.send(post || null);
The same goes for 0.2.12 but everything works fine with 0.2.11.
The text was updated successfully, but these errors were encountered: