RedirectRegex middleware deletes header

Hi all,

I'm using traefik v2.2.0, and when I provide a header using curl, the header gets to traefik but not to redirected url.

My dynamic config:

http:
  routers:
    risk-management-router:
      rule: PathPrefix(`/risk-management`)
      entryPoints:
        - http
      middlewares:
        - risk-management-redirect
      service: external-url

  middlewares:
    risk-management-redirect:
      redirectRegex:
        regex: ^http://localhost/(.*)
        replacement: https://external.url.com/${1}

  services:
    external-url:
      loadBalancer:
        servers:
        - url: https://external.url.com/ 

When I'm using curl -vL -H "authorization: bearer MYTOKEN" http://localhost/risk-management/scans/scans/latest?statusName=Scanning

That's the output:

*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /risk-management/scans/scans/latest?statusName=Scanning HTTP/1.1
> Host: localhost
> User-Agent: curl/7.55.1
> Accept: */*
> authorization: bearer MYTOKEN
>
< HTTP/1.1 302 Found
< Location: https://external.url.com/risk-management/scans/scans/latest?statusName=Scanning
< Date: Tue, 21 Apr 2020 16:43:40 GMT
< Content-Length: 5
< Content-Type: text/plain; charset=utf-8
<
* Ignoring the response-body
* Connection #0 to host localhost left intact
* Issue another request to this URL: 'https://external.url.com/risk-management/scans/scans/latest?statusName=Scanning'

*   Trying 143.204.237.52...
* TCP_NODELAY set
* Connected to external.url.com (143.204.237.52) port 443 (#1)
* schannel: Succesful handshake
> GET /risk-management/scans/scans/latest?statusName=Scanning HTTP/1.1
> Host: external.url.com
> User-Agent: curl/7.55.1
> Accept: */*
>
* schannel: client wants to read 102400 bytes
* schannel: encdata_buffer resized 103424
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: encrypted data got 526
* schannel: encrypted data buffer: offset 526 length 103424
* schannel: decrypted data length: 497
* schannel: decrypted data added: 497
* schannel: decrypted data cached: offset 497 length 10240
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: decrypted data buffer: offset 497 length 102400
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 497
* schannel: decrypted data buffer: offset 0 length 102400

< HTTP/1.1 401 Unauthorized
< Content-Type: application/json
< Content-Length: 26
< Connection: keep-alive

< Date: Tue, 21 Apr 2020 16:43:16 GMT
< x-amzn-RequestId: 9a67ec04-5097-4f3d-8692-d45b10fa279f
< x-amzn-ErrorType: UnauthorizedException
< x-amz-apigw-id: LWJZrGrkIAMF-ZA=
< X-Cache: Error from cloudfront
< Via: 1.1 1ebf52f5e79648444025879af65610d2.cloudfront.net (CloudFront)
< X-Amz-Cf-Pop: CPH50-C1
< X-Amz-Cf-Id: _rmiW2lrXgvUZmtDdGr5H3Cp1jctASWrjFal06u6ICGoU0sLoGGLrA==
<
{"message":"Unauthorized"}* Connection #1 to host external.url.com left intact

As you can see, the request to external.url.com is without the authorization header.

Thanks for the help.