       .childChannelInitializer { channel in
         channel.pipeline.configureHTTPServerPipeline().then {
           let handlers: [ChannelHandler] = gzip
-            ? [HTTPResponseCompressor(), Handler(middleware)]
-            : [Handler(middleware)]
+            ? [HTTPResponseCompressor(), Handler(baseUrl: baseUrl, middleware: middleware)]
+            : [Handler(baseUrl: baseUrl, middleware: middleware)]
           return channel.pipeline.addHandlers(handlers, first: false)
         }
       }

private final class Handler: ChannelInboundHandler {
  typealias InboundIn = HTTPServerRequestPart

  var request: URLRequest?
  let middleware: Middleware<StatusLineOpen, ResponseEnded, Prelude.Unit, Data>

  init(_ middleware: @escaping Middleware<StatusLineOpen, ResponseEnded, Prelude.Unit, Data>) {
    self.middleware = middleware
  }


      }
    case .end:
      guard let req = self.request else {
        _ = ctx.channel.write(HTTPServerResponsePart.head(HTTPResponseHead(
          version: .init(major: 1, minor: 1),
          status: .init(statusCode: 307),
          headers: .init([("location", self.baseUrl.absoluteString)])
        )))
        _ = ctx.channel.writeAndFlush(HTTPServerResponsePart.end(nil)).then {
          ctx.channel.close()
        }
        return
      }

