private async Task ApplyResponseContent(HttpResponse response, IDocumentHandler handler)
        {
            using (var content = handler.Open())
            {
                response.ContentLength = _layoutHead.Length + content.Length + _layoutTail.Length;
                await response.Body.WriteAsync(_layoutHead, 0, _layoutHead.Length);

                await content.ContentStream.CopyToAsync(response.Body);

                await response.Body.WriteAsync(_layoutTail, 0, _layoutTail.Length);
            }
        }
        private async Task ApplyResponseContent(HttpResponse response, IDocumentHandler handler, string lang)
        {
            byte[] layoutHead = null;
            byte[] layoutTail = null;

            if (lang != null)
            {
                _layoutHeadsByLanguage.TryGetValue(lang, out layoutHead);
                _layoutTailsByLanguage.TryGetValue(lang, out layoutTail);
            }

            layoutHead = layoutHead ?? _defaultLayoutHead;
            layoutTail = layoutTail ?? _defaultLayoutTail;

            using (var content = handler.Open())
            {
                response.ContentLength = layoutHead.Length + content.Length + layoutTail.Length;
                await response.Body.WriteAsync(layoutHead, 0, layoutHead.Length);

                await content.ContentStream.CopyToAsync(response.Body);

                await response.Body.WriteAsync(layoutTail, 0, layoutTail.Length);
            }
        }
		private async Task ApplyResponseContent(HttpResponse response, IDocumentHandler handler)
		{
			//TODO: update response.ContentLength
			//https://github.com/aspnet/vsweb-docs/blob/aa6db2a87ed91214509382684d0a093945539dc8/src/app_code/PageSystem.cs#L73

			using (var content = handler.Open())
			{
				response.ContentLength = _layoutHead.Length + content.Length + _layoutTail.Length;
				await response.Body.WriteAsync(_layoutHead);
				await content.ContentStream.CopyToAsync(response.Body);
				await response.Body.WriteAsync(_layoutTail);
			}
		}