What you were expecting:
no more complains about 'x-total-count'
What happened instead:
missing 'x-total-count'
Steps to reproduce:
on client side
<Admin dataProvider={jsonServerProvider("http://localhost:8000")}>
//...
</Admin>
on server side
app.get("/company", async (req, res) => {
// ...
const total = await Company.count();
res.set("x-total-count", total);
res.send(data);
});
Other information:
tracked down to convertDataRequestToHTTP
the only header in the response is content-type application/json; charset=utf-8
all other headers got removed?
Environment
If it helps anyone, as the warning suggests, I had to add:
res.header('Access-Control-Expose-Headers', 'X-Total-Count')
in my express app to the response for cors 'OPTIONS' request.
Most helpful comment
If it helps anyone, as the warning suggests, I had to add:
res.header('Access-Control-Expose-Headers', 'X-Total-Count')in my express app to the response for cors 'OPTIONS' request.