From 6bfcd4a2d46808a8ae2e810a7f898ca4b30b45b7 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Mon, 6 Nov 2017 20:28:08 -0800 Subject: [PATCH] Remove header serialization in favor of setting IIS response directly. (#228) --- src/AspNetCore/Src/managedexports.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/AspNetCore/Src/managedexports.cxx b/src/AspNetCore/Src/managedexports.cxx index b0a31daa5f..a44980f476 100644 --- a/src/AspNetCore/Src/managedexports.cxx +++ b/src/AspNetCore/Src/managedexports.cxx @@ -355,4 +355,30 @@ http_cancel_io( return pHttpContext->CancelIo(); } +EXTERN_C __MIDL_DECLSPEC_DLLEXPORT +HRESULT +http_response_set_unknown_header( + _In_ IHttpContext* pHttpContext, + _In_ PCSTR pszHeaderName, + _In_ PCSTR pszHeaderValue, + _In_ USHORT usHeaderValueLength, + _In_ BOOL fReplace +) +{ + return pHttpContext->GetResponse()->SetHeader( pszHeaderName, pszHeaderValue, usHeaderValueLength, fReplace ); +} + +EXTERN_C __MIDL_DECLSPEC_DLLEXPORT +HRESULT +http_response_set_known_header( + _In_ IHttpContext* pHttpContext, + _In_ HTTP_HEADER_ID dwHeaderId, + _In_ PCSTR pszHeaderValue, + _In_ USHORT usHeaderValueLength, + _In_ BOOL fReplace +) +{ + return pHttpContext->GetResponse()->SetHeader( dwHeaderId, pszHeaderValue, usHeaderValueLength, fReplace ); +} + // End of export \ No newline at end of file