feat: add sentry report wrapper to every api route in appDir (#19966)
* update oauth tests * fix parseRequestData * add logging * add fallback * use ?? * updates * use parseUrlFormData in saml/callback * update tests * fix * remove log * update * any -> unknown * use HttpErrors * addressed * unknown -> any * feat: Add entry report wrapper to every api route in appDir * fix * fix unit test * fix
This commit is contained in:
1 parent
1e9f3a8060
commit
87bc8d649a
49 files changed
+180
-76
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { defaultResponderForAppDir } from "app/api/defaultResponderForAppDir";
|
||||
import { createHmac } from "crypto";
|
||||
import { headers } from "next/headers";
|
||||
import { cookies } from "next/headers";
|
||||
@@ -21,7 +22,7 @@ const helpscoutRequestBodySchema = z.object({
|
||||
* API for Helpscout to retrieve key information about a user from a ticket
|
||||
* Note: HelpScout expects a JSON with a `html` prop to show its content as HTML
|
||||
*/
|
||||
export async function POST(request: NextRequest) {
|
||||
async function postHandler(request: NextRequest) {
|
||||
const hsSignature = request.headers.get("x-helpscout-signature");
|
||||
if (!hsSignature) return NextResponse.json({ message: "Missing signature" }, { status: 400 });
|
||||
|
||||
@@ -94,3 +95,5 @@ export async function POST(request: NextRequest) {
|
||||
return NextResponse.json({ message: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
export const POST = defaultResponderForAppDir(postHandler);
|
||||
Reference in new issue
Block a user