Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/api/health/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
import { withApiHandler } from "@/lib/backend/withApiHandler";
import { ok, methodNotAllowed } from "@/lib/backend/apiResponse";
import { logInfo } from "@/lib/backend/logger";
import { attachSecurityHeaders } from "@/utils/response";
import { ok } from "@/lib/backend/apiResponse";

export const GET = withApiHandler(async (req: NextRequest) => {
logInfo(req, "Healthcheck requested");
Expand Down
3 changes: 2 additions & 1 deletion src/app/api/ready/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NextResponse } from 'next/server';
import { withApiHandler } from '@/lib/backend/withApiHandler';
import { logger } from '@/lib/backend';
import { methodNotAllowed } from '@/lib/backend/apiResponse';

Expand Down Expand Up @@ -37,7 +38,7 @@ async function checkSorobanRpc(): Promise<{ reachable: boolean; latencyMs?: numb
}
}

export async function GET() {
export const GET = withApiHandler(async () => {
logger.info('Readiness check requested');

const rpc = await checkSorobanRpc();
Expand Down
2 changes: 1 addition & 1 deletion tests/api/commitments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('GET /api/commitments', () => {
expect(Array.isArray(result.data.data.items)).toBe(true)
})

it('should return commitments filtered by status', async () => {
it('should include security headers on response', async () => {
const request = createMockRequest(
'http://localhost:3000/api/commitments?ownerAddress=GOWNER&status=active'
)
Expand Down
2 changes: 1 addition & 1 deletion tests/api/health.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('GET /api/health', () => {
expect(timestamp.toString()).not.toBe('Invalid Date')
})

it('should return version in response', async () => {
it('should include security headers', async () => {
const request = createMockRequest('http://localhost:3000/api/health')
const response = await GET(request, createMockRouteContext())
const result = await parseResponse(response)
Expand Down
Loading