proudmonkey / AutoWrapper

A simple, yet customizable global exception handler and Http response wrapper for ASP.NET Core APIs.
MIT License
679 stars 82 forks source link

Cannot Retrieve Image #78

Closed BlazorPlate closed 3 years ago

BlazorPlate commented 3 years ago

Hi,

First of all, I want to thank you for your effort.

I have an issue when retrieving an image from its URL path. e.g. when I request https://localhost:1234/users/ProfilePicture.png, the browser displays the following response with some random data instead of the actual image.

"message": "GET Request successful.", "result": "�PNG\r\n\u001a\n\u0000\u0000\u0000\rIHDR\u0000\u0000\u0005�\u0000\u0000\u0001�\b\u0006\u0000\u0000\u0000���\u000b\u0000\u0000\u0000\u0001sRGB\u0000��\u001c�\u0000\u0000\u0000\u0004gAMA\u0000\u0000��\u000b�a\u0005\u0000\u0000\u0000\tpHYs\u0000\u0000\u0012t\u0000\u0000\u0012t\u0001�f\u001fx\u0000\u0000��IDATx^��\u000f\V����w\"a�0':�a\u000b\fɰ�\u0016갅\u0015�li}�m��߆K[�����&mZ�K��M�쏕����t��蛔Q�L2$�

BlazorPlate commented 3 years ago

Well, I managed to fix the issue by putting app.UseStaticFiles(); before app.UseApiResponseAndExceptionWrapper.

Thank you anyways.