Skip to content

Bug: passthrough_headers cannot be cleared via gateway edit form #4228

@ecthelion77

Description

@ecthelion77

Description

When editing a gateway in the admin UI and clearing the passthrough_headers field (removing all values), the field retains its previous value. There is no way to clear it once set.

Steps to Reproduce

  1. Create or edit a gateway with passthrough_headers set (e.g. ["Authorization", "X-Custom"])
  2. Edit the gateway in the admin UI
  3. Clear the passthrough_headers field (remove all text)
  4. Save the gateway
  5. Observe: the field still contains the previous values

Root Cause

In admin.py, str(form.get("passthrough_headers")) converts an empty/None form value to the Python string "None", which is truthy. The subsequent parsing logic treats it as valid input rather than a cleared field.

Additionally, in gateway_service.py, when an empty list [] is passed (meaning "user cleared the field"), it is stored as-is in the DB rather than being converted to None (the canonical "no passthrough headers" value).

Expected Behavior

Clearing the passthrough_headers field in the edit form should remove all passthrough headers from the gateway (store None in DB).

Environment

  • Version: main (HEAD)
  • Component: Admin UI + Gateway Service

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions