2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-04-12 20:01:30 +00:00

Tolerate different proxy pass configurations

The stock reverse proxy configuration strips the leading
'/confluent-api/' from the URL.

However, when doing a custom reverse proxy set up, one may preserve full
path without knowing which way to go.

Since '/confluent-api/' will never be used inside the api, just strip
it when detected to tolerate either of the likely proxy pass behaviors.
This commit is contained in:
Jarrod Johnson
2025-03-11 11:38:05 -04:00
parent d2011261ab
commit 9136341bda

View File

@@ -628,6 +628,8 @@ def wsock_handler(ws):
def resourcehandler(env, start_response):
if env['PATH_INFO'].startswith('/confluent-api'):
env['PATH_INFO'] = env['PATH_INFO'].replace('/confluent-api', '')
for hdr in env['headers_raw']:
if hdr[0].lower().startswith('confluent'):
hdrname = hdr[0].upper()