huacnlee / rucaptcha

Captcha Gem for Rails, which generates captcha image by Rust.
https://huacnlee.github.io/rucaptcha
MIT License
695 stars 133 forks source link

rucaptcha_image_tag custom host #39

Closed sforce100 closed 7 years ago

sforce100 commented 7 years ago

when my assets is upload upyun, i need config assets host with upyun host. so i need custom host for rucaptcha_image_tag.

huacnlee commented 7 years ago

/rucaptcha 的路径是不能放 CDN 的呀!?

sforce100 commented 7 years ago

是的!就是因为/rucaptcha不能放cdn。因为1.2.0版本rucaptcha_image_tag获取的路由是用root_path。这样它就自动识别到cdn的host,所以我需要在rucaptcha_image_tag方法自定义一个host。

huacnlee commented 7 years ago

你的网站动态内容前面是有 CDN?

你只需要配置 CDN 上,让 /rucaptcha 不缓存就可以了呀