3 ms·
Great idea. I just implement it: https://github.com/yeo/ec2.shop/commit/ab258aef3ac2ad3d45b26d76304476424379a77c https://github.com/yeo/ec2.shop/commit/ab258ae
by kureikain 6y ago
Great idea.
I just implement it: https://github.com/yeo/ec2.shop/commit/ab258aef3ac2ad3d45b26d76304476424379a77c https://github.com/yeo/ec2.shop/commit/ab258aef3ac2ad3d45b26...
Now by default it's text mode, so request by http client library or tool like curl, wget, httppie all get text bersion.
Only when detecting `Accept` contains `html` and user agent is safari/chrome/firefox etc it send html version.
- karmakaze 6y agoThere should be no reason to check user agent if already checking `Accept`. That's usually more for browser quirks or allow/blocking.