If you run this in the browser console while on https://stacker.news it'll return 200 for an arbitrary data request.
const headers = new Headers() headers.append('X-Nextjs-Data', '1') fetch('https://stacker.news/_next/data/this_doesnt_exist.json', { headers }).then(console.log)
If I remove the middleware it works as expected and 404s.
I guess I should report this a bug to nextjs.
reply
All this software between us and our users almost makes me believe I want to be a hardware engineer, not a software engineer, lol
reply
tbf hardware engineers have even more software between their work and their customers lol
Software's composability is ultimately a feature and not a bug. It's why everyone makes software and a relatively small number of people make hardware ... and even hardware people rely on 3rd party components which are horrifyingly opaque and suffer from super slow release cycles.
There's an ex-hardware guy in Pleb Lab right now who has transitioned to software. The main upside afaict is how tangible his work was. I can buy the stuff he designed on Amazon and it can sit on my desk.
I totally get it though. I studied a lot of circuits and engineering in college wanting to be a sovereign full stacker to an absurd degree, but the reality is we're all dependent on something.
reply
I see, must be related to how their client side navigation works since only during client side navigation, these /_next/data/ routes are called, I think.
reply
deleted by author
reply