Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML forbidden page #35

Open
Maxy-Paulo opened this issue Sep 28, 2022 · 3 comments
Open

HTML forbidden page #35

Maxy-Paulo opened this issue Sep 28, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Maxy-Paulo
Copy link

Maxy-Paulo commented Sep 28, 2022

Hello,
I tried a sample HTML code as a return from the bouncer when blocked.
But, It's showed on the browser as plain text and not HTML page.

Is it planned to switch the bouncer reply to HTML ?

2022-09-28 14_05_00

CROWDSEC_BOUNCER_BAN_RESPONSE_MSG = "<!DOCTYPE html><html lang=\"en\"><head><title>403</title></head><body><h1>403</h1><h2>Access forbidden !</h2></body></html>"

@fbonalair fbonalair added the enhancement New feature or request label Oct 9, 2022
@fbonalair
Copy link
Owner

Right now, the response from the bouncer is hardcoded to be a text, that's why in the Response Header the content-type is text/plain and the browser interpret that raw.
I have checked the underlying framework, it would be possible to read a HTML template file and send that to end user. If the environment variable change to CROWDSEC_BOUNCER_BAN_RESPONSE and you put your HTML template file path there instead, would that work for you?
I can't give any estimate time of arrival though.

@joehill1810
Copy link

Is there any update on if this is feasible or not? I have tried the above but it did not work for me. I know it's a fairly low-priority addition, but it would make it nicer

@RedJohn14
Copy link

Hello @fbonalair that would be great any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants