-
Hi, I'm trying to use tunnelRoute option to avoid ad blockers in a NextJS project. This correctly sends the captureException requests to a route handler I created under monitoring/route.ts (I'm using App Router). The problem is that the request uses GET method, and NextJS is not able to retrieve the body from it (it seems to be a problem with DELETE as well, you can see an issue here). So I'm wondering if there is a way for me to change the method to a POST within captureException so I can correctly retrieve the data. Maybe I'm doing something wrong here or maybe I need to raise this in Next repo, but wanted to ask first, maybe someone ran into this issue before? Couldn't find anything specific to this. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'll close this question because I found the problem (and maybe is useful for someone else running into this issue). Sentry was correctly sending a POST request, but because I had a middleware that I use for localization purposes, it was redirecting the request as a GET instead. I just added the monitoring route to the matcher and now it works perfectly fine. Thanks! |
Beta Was this translation helpful? Give feedback.
I'll close this question because I found the problem (and maybe is useful for someone else running into this issue). Sentry was correctly sending a POST request, but because I had a middleware that I use for localization purposes, it was redirecting the request as a GET instead. I just added the monitoring route to the matcher and now it works perfectly fine. Thanks!