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
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase is not working in .net core 2.0 above versions #2240
Comments
@synckarthik can you please post full .NET Core 2.1+ repro that we can route to the right team? Thanks! |
Hi Guys, I have attached the sample for HTML 5 uploader with xmlHttpRequest to send the form data. Steps to reproduce: Run the sample and select any file. Then click on uploadFile button,. Your file will be uploaded in to wwwroot folder now. But message not received in dotnet core 2.1 project. Below you can get 2.0 project. Below you can get 2.1 project. Please check it. |
@synckarthik no idea from me - when @Eilon is back, he can route it on ASP.NET team. |
@Tratcher Can you take a look? |
@synckarthik I was able to reproduce this with your samples and I see the difference. This is not caused by any code changes in the framework, it's caused by a project configuration change. The 2.0 project templates did not have HTTPS enabled by default, the 2.1 templates do. When using HTTP the browser uses HTTP/1.1 and ReasonPhrase works as expected. When using HTTPS the browser uses HTTP/2 and ReasonPhrase no longer works. The reason it doesn't work is because the HTTP/2 protocol has removed the concept of ReasonPhrase. That's one of the reasons we excluded it from HttpResponse. Suggested workaround: use a custom header instead. |
@Tratcher , Thank you for your detailed explanation. I will use custom header. |
Hi Guys, Http response custom header not working properly asp.net core 2.2 web api response. We used the html upload box in our project. While upload fails, we will pass the custom message through httprequest to client side. Our server side section is in .net core project (2.1). So we have used the below code to send custom message
It working fine core 2.1. While using the above code in .net core 2.2 project, it does not works. How to resolve this in our side? Please suggest your ideas. Regards, |
Are you sure it's not using Http/2 a like discussed above? |
Issue Title
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase
is not working in .net core 2.0 above versionsGeneral
We used the html upload box in our project. While upload fails, we will pass the custom message through httprequest to client side. Our server side section is in .net core project (2.0). So we have used the below code to send custom message
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = "File already exists.";
It working fine.
While using the above code in .net core 2.1 project, it does not works.
How to resolve this in our side? Please suggest your ideas.
The text was updated successfully, but these errors were encountered: