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
nabinked
merged 1 commit into
nabinked:master
from
dkolarev:hotfix/Non-ASCII_characters_in_Ajax_request
Mar 20, 2019
Merged
UTF-8 characters in AJAX request #62
nabinked
merged 1 commit into
nabinked:master
from
dkolarev:hotfix/Non-ASCII_characters_in_Ajax_request
Mar 20, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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
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
Great stuff man. I will try to merge this in tonight. Thanks. Much appreciated and sorry I have not been able to pay much attention to this repo
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
बाट: Davor Kolarević <notifications@github.com>
पठाइयो: Thursday, March 21, 2019 1:51:27 AM
प्रापक: nabinked/NToastNotify
बोधार्थ: Subscribed
विषय: [nabinked/NToastNotify] When using UTF-8 characters in AJAX request toastr I got exception. T… (#62)
…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
________________________________
You can view, comment on, or merge this pull request online at:
#62<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnabinked%2FNToastNotify%2Fpull%2F62&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890810147&sdata=7xK7IWO%2BEfuZ%2BXWEBRrb%2By8qIcRsSO3p%2F1dopKglwik%3D&reserved=0>
Commit Summary
* 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.
File Changes
* M src/Js/dist/noty.js<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnabinked%2FNToastNotify%2Fpull%2F62%2Ffiles%23diff-0&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890820158&sdata=AkkP2JkHKAqZV27mKDokHsUOJUeKnut2oDl2ybanj9Q%3D&reserved=0> (2)
* M src/Js/dist/toastr.js<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnabinked%2FNToastNotify%2Fpull%2F62%2Ffiles%23diff-1&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890830163&sdata=2yitiH3NZnJR66O4IcDj2LYq6h5HJQeXpQUtOTStgx0%3D&reserved=0> (2)
* M src/Js/src/NToastNotify.ts<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnabinked%2FNToastNotify%2Fpull%2F62%2Ffiles%23diff-2&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890840174&sdata=BBesR0PGVZpgOWyBwXxNCSl2EkCViN1nv5rqQndTYGg%3D&reserved=0> (7)
* M src/NtoastNotifyAjaxToastsMiddleware.cs<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnabinked%2FNToastNotify%2Fpull%2F62%2Ffiles%23diff-3&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890850185&sdata=QqOsTQ3%2BLMI23Qg6cXKp90hnvAYL6hdFq5wFYH0BdEo%3D&reserved=0> (3)
Patch Links:
* #62.patch<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnabinked%2FNToastNotify%2Fpull%2F62.patch&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890860190&sdata=Y6zKS8mhtoSrrUSjrKlA6nLO3Yu7ijcxnDngN0ol74c%3D&reserved=0>
* #62.diff<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnabinked%2FNToastNotify%2Fpull%2F62.diff&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890870207&sdata=ijz61nVAk9%2B30YRfX5UQRg72rXmJh2JJRZ%2FUXmuaZP8%3D&reserved=0>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnabinked%2FNToastNotify%2Fpull%2F62&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890890212&sdata=M3e8HuwZKnNNh%2BnE%2Bdk1%2BaSgBkfSckiGonyO7WxXZIc%3D&reserved=0>, or mute the thread<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHWKi364CD78WgQ-XmASyU5iEhFKPWjyks5vYkrvgaJpZM4b_ftC&data=02%7C01%7C%7C930ef109b3b54779da3e08d6ad438825%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886902890900217&sdata=6iXPJPNS485RWOA3DWcalMO3OE0V2xn3KcLvwTWjnto%3D&reserved=0>.
|
Will push a release to nuget later |
Thanks @nabinked I appreciate that. I really need nuget package soon. |
This was referenced Mar 21, 2019
new versoin is up already |
Thank you for your answer. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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