Skip to content
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

UTF-8 characters in AJAX request #62

Merged

Conversation

dkolarev
Copy link
Contributor

@dkolarev dkolarev commented Mar 20, 2019

When using UTF-8 characters in AJAX request toastr I got exception. The reason was that non-ASCII characters are not allowed in HTTP response headers.

The solution is to add message encoding in

NtoastNotifyAjaxToastsMiddleware.cs in line httpContext.Response.Headers.Add(Constants.ResponseHeaderKey, WebUtility.UrlEncode(messagesJson));

and decoding in NToastNotify.ts

This is for issue #61 and #37

…he reason was that non-ASCII characters are not allowed in HTTP response headers.

The solution is to add message encoding in

NtoastNotifyAjaxToastsMiddleware.cs in line httpContext.Response.Headers.Add(Constants.ResponseHeaderKey, WebUtility.UrlEncode(messagesJson));

and decoding in NToastNotify.ts
@dkolarev dkolarev changed the title When using UTF-8 characters in AJAX request toastr I got exception. T… UTF-8 characters in AJAX request Mar 20, 2019
@nabinked
Copy link
Owner

nabinked commented Mar 20, 2019 via email

@nabinked nabinked merged commit 2120739 into nabinked:master Mar 20, 2019
@nabinked
Copy link
Owner

Will push a release to nuget later

@dkolarev
Copy link
Contributor Author

dkolarev commented Mar 21, 2019

Thanks @nabinked I appreciate that. I really need nuget package soon.

@nabinked
Copy link
Owner

new versoin is up already

@ghost
Copy link

ghost commented Mar 21, 2019

Thank you for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants