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

ASP Core Middleware improperly encodes serverMessage #2217

Open
rdeprins opened this issue Jan 5, 2023 · 0 comments
Open

ASP Core Middleware improperly encodes serverMessage #2217

rdeprins opened this issue Jan 5, 2023 · 0 comments
Labels

Comments

@rdeprins
Copy link

rdeprins commented Jan 5, 2023

Hi Ignite team,

I'm not sure if this is the right location for Middleware issues, since Infragistics.Web.AspNetCore is not open-source. But I was referred to here from the Infragistics forums: https://www.infragistics.com/community/forums/f/ignite-ui-for-asp-net-mvc/124959/asp-core-middleware-improperly-encodes-servermessage

We have to send some additional data to the client side javascript, more specifically in the iguploadfileuploaded event.
To do that, we bind to FinishingUploadEventHandler and put that data in UploadFinishingEventArgs.ServerMessage.

This works fine in ASP.NET, but we are in the process of upgrading to ASP.NET Core 2.2. Both on Framework runtime.
The new Middleware for Core mostly works fine. Except for this ServerMessage.

In old ASP we get the response from ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx as expected.
But in Core there are null chars in between the regular chars:

I can't even copy-paste the text here because windows clipboard thinks the text terminates after the first null. And javascript probably thinks the same, because the fileuploaded event is triggered with an empty serverMessage.

It looks like maybe Kestrel is expecting UTF8 and the middleware is writing UTF16, leaving 1 char gaps?

Steps to reproduce

  1. Create new .Net Framework 4.7.2 web project using ASP Core 2.2.0
  2. Set up middleware as instructed here https://www.igniteui.com/help/using-igniteui-controls-in-asp.net-core-project#middleware
  3. Bind to server-side event UploadFinishing as instructed here https://www.igniteui.com/help/igupload-using-server-side-events
  4. Set serverMessage in this event
  5. Observe the browser network debugger.

Result

What is the actual result after following the steps to reproduce?
See screenshot

Expected result

<root><serverMessage>{"FileId":null,"Filename":"80831.HA.Mono.pdf","Path":"D:\\Temp\\TempUpload\\igUploadAgencyUploader\\80831.HA.Mono.pdf"}</serverMessage></root>

@rdeprins rdeprins added the bug label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant