Exemple #1
0
        public AfterHandleRequestResult AfterHandleRequest(IHttpServerRequest request, HttpServerResponse httpResponse)
        {
            string origin;
            if (!TryGetAllowOrigin(request.Origin, out origin))
                return null;

            httpResponse.AddHeader(new AccessControlAllowOriginHeader(origin));
            return new AfterHandleRequestResult(httpResponse);
        }
Exemple #2
0
 private static void AddHeaderIfNotNull(IHttpHeader contentEncodingHeader, HttpServerResponse newResponse)
 {
     if (contentEncodingHeader != null)
     {
         newResponse.AddHeader(contentEncodingHeader);
     }
 }