/Knowledge/sources/honojs__hono/llms-full/middleware-custom-middleware-modify-the-response-after-next--65b6c9d76c80.md
Middleware: Custom Middleware > Modify the Response After Next - hono...
Middleware: Custom Middleware Modify the Response After Next Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms fu...
Middleware: Custom Middleware > Modify the Response After Next
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#modify-the-response-after-next
Summary
Additionally, middleware can be designed to modify responses if necessary: ts const stripRes = createMiddleware(async (c, next) => { await next() c.res = undefined c.res = new Response('New Response') })
Content
Additionally, middleware can be designed to modify responses if necessary:
const stripRes = createMiddleware(async (c, next) => {
await next()
c.res = undefined
c.res = new Response('New Response')
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#modify-the-response-after-next",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Middleware > Custom Middleware > Modify the Response After Next",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 116,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Middleware: Custom Middleware > Modify the Response After Next",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}