-
Notifications
You must be signed in to change notification settings - Fork 167
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
Be able to overwrite http response in IFunctionsWorkerMiddleware #530
Comments
I believe this should be possible, but it may not be straightforward -- we'll investigate this and add a sample if it's possible today. Otherwise, we'll expose this. |
I asked a similar question on SO; that would be really nice if the use case was supported. |
@brettsam is still tracking this, but we'll need to push this to the next sprint. We'll continue to use this issue for updates. |
Would really appreciate an update on this issue, thanks! |
Same here, I'm waiting after this to improve errors message for our customers, be able to returns 401 / 403 with an error message can do a really big change from a generic 500. |
A bit hacky, but I was able to achieve this by setting up a couple extensions methods and a class that inherited from IFunctionsWorkerMiddleware:
|
Assigning this to sprint 113 for initial design. We'll share more information here once that is done. |
Work on this is still in progress. Updating sprint assignment |
When your function has multiple outputs you also need to add the HttpResponseData to the OutputBindingData dictionary to get the correct http response in your client.
` |
@frourke indeed. Those are the kinds of things we want to abstract away and make we have simple APIs that will do the right thing for you. |
Is this still in progress? |
@RomanAlberdaSoftserveInc Yes, we are currently working on this item. The new APIs to support reading & altering input and output data from middleware will be available in the next few weeks. I will share an update to this thread as we make progress. Thanks! |
Moving to sprint 118 as work is still in progress. |
PR for this is out and being reviewed (#814) |
@mauleb We plan to release next week. I will update this thread when the packages are published. Thanks! |
@kshyju would documentation get some love as well? |
Absolutely. That is the plan. |
@kshyju following up on the documentation 🙂 |
@kshyju Just wondering, is the documentation ready? Or, is there a code example on github to refer to? |
@kshyju Do you have any update on when this change will be released? |
Version 1.8.0-preview1 of Here is an example of updating the http response inside a middleware.
Refer the sample app for more middleware examples. |
Can we get a set method instead? This API feels awkward.
|
@davidpeden3 Agreed. The method naming feels contrary to the intended use and purpose. Since this is a ‘set’ operation, something like |
@SeanFeldman The middleware section on the official documentation page has been updated with information about some of the new APIs we exposed along with an example middleware implementation. We will continue to iterate. Thanks for the reminder. |
Hello,
In ASP.NET Core I have a middleware that try/catch around the
next(context)
and depending on the exception, set response body and set status codeI would like to do the same in azure function in
IFunctionsWorkerMiddleware
but it's not possible currently, the FunctionContext does not explose anything to do that.The text was updated successfully, but these errors were encountered: