Skip to content

Conversation

@aleskiontherun
Copy link
Contributor

Fixes #6

@NickMRamirez
Copy link
Collaborator

Thanks for the pull request @Dizeee. Unfortunately, in its current state, this does not work because it doesn't send back the Access-Control-Allow-Methods response header for an OPTIONS request.

@aleskiontherun
Copy link
Contributor Author

@NickMRamirez I tested with HAProxy 2.1.4, and it does. Access-Control-Allow-Methods header is added by preflight_request function, which is executed before returning the response.

Billie_Account_UI

@erolg
Copy link

erolg commented Aug 14, 2020

@Dizeee

It works but I got the following alert:

haproxy[1414]: [ALERT] 226/212022 (7638) : Lua applet http '<lua.empty-response>': runtime error: /var/lib/haproxy/cors.lua:91: bad argument #1 to 'send' (string expected, got nil) from [C] method 'send', /var/lib/haproxy/cors.lua:91 C function line 87.

Alert gone when I changed send function like that: applet:send("")

@NickMRamirez
Copy link
Collaborator

I've updated the module to terminate preflight requests using the new Reply object in the HAProxy Lua library, but it does require HAProxy 2.2. #15

@aleskiontherun aleskiontherun deleted the options-termination branch November 27, 2021 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Terminating preflight options requests

3 participants