Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sending the same reply regardless of whether the user is using Js or not is not a feature. It's lazy. You wouldn't even need to change a single thing about the front end to fix this on the back end, since the js request via Ajax already has an additional header field (x-sent-via: Xmlhttprequest or something along the lines). This might be as simple as wrapping output generation in a single if-statement.


> the js request via Ajax already has an additional header field

No, X-Requested-With is a non-standard header set by frameworks like jQuery. But it’s trivial to set something like that with either XHR or fetch.


Thanks for the heads up. The only time I came in contact with actual web dev was indeed jQuery, and the couple other times I looked at the dev tools might have been pages using it as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: