Turns out we don't need the bloody middleware at all.