Skip to content

bug: forward-auth with request_method GET causes timeouts #10927

Description

@BrandonArp

Current Behavior

The request to the forward-auth request contains a Content-Length header and the GET request has no body.

Expected Behavior

The forward-auth request has no Content-Length header.

Error Logs

apisix-1  | 2024/02/07 20:27:39 [error] 242#242: *648462 [lua] forward-auth.lua:134: phase_func(): failed to process forward auth, err: timeout, client: 172.27.0.1, server: _, request: "POST /test HTTP/1.1", host: "localhost:9080"
apisix-1  | 2024/02/07 20:27:39 [warn] 242#242: *648462 [lua] plugin.lua:1159: run_plugin(): forward-auth exits with http status code 403, client: 172.27.0.1, server: _, request: "POST /test HTTP/1.1", host: "localhost:9080"

Steps to Reproduce

  1. Run APISIX
  2. Deploy a service that can consume forward-auth requests
  3. Create a route that has forward-auth enabled, with a GET request_method
    You can use the following plugin config:
    forward-auth:
         keepalive: true
         keepalive_pool: 100
         keepalive_timeout: 2000
         request_headers:
           - Authorization
         request_method: GET
         uri: http://some_auth_service/auth```
  4. Send 2 requests to the protected route
  5. Observe that the second request will fail with a timeout

Environment

  • APISIX version 3.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions