EDIT: I totally missed the fact that the Request URL is NOT the REST API URL, but the actual web page URL. Next.js seems to be sending requests to the actual web page. Lastly, I'm suspecting that these request are being sent from the build folder, since that's where I found '/_next/data' in my codebase. That being said, is it the middleware that is causing this? Also, getServerSide props is not used in this project.
Currently a Next.js 13 project I am working seems to be sending strange requests to the web page which all end in status 403. Here are some examples
https://hello.com/_next/data/6jowMdw4HAQlDr5Y8O6JJ/connector/connectorManagement.json?p=1
https://hello.com/_next/data/6jowMdw4HAQlDr5Y8O6JJ/charging/calculateFailureHistory.json
https://hello.com/_next/data/6jowMdw4HAQlDr5Y8O6JJ/station/chargeGroup.json
We have 2 deployments for frontend, dev (http) and prod (https) and only prod seems to be having this problem whereas dev does not send these requests at all (local does send these requests and receive 200 status ). We also have corresponding API's (dev and prod)
When ran on local, the requests return a 200 status and look like this and the response is an actual html. I have attached the response preview below. (We use a REST API)
Request URL:
http://localhost:PORT/_next/data/development/charging/chargingProfile.json
Request Method:
GET
Status Code:
200 OK
Remote Address:
-
Referrer Policy:
strict-origin-when-cross-origin
Here is the Baggage of the request headers
sentry-environment=development,sentry-public_key=public_key,sentry-trace_id=trace_id,sentry-sample_rate=1,sentry-sampled=true
So here's what I don't understand:
- Is this stemming from backend or frontend?
- Is it a next.js configuration issue?
- Is it an axios interceptor issue?
- Is it a sentry configuration issue?
If it matters, our REST API is made with php.
