Conversation
|
Does hasRoute need also some love? |
There is no API changes in |
|
CI failure due to Github Actions outage I will re-run the CI after Github fix it. |
|
Github Actions run again properly Code coverage is low |
| }) | ||
| ``` | ||
|
|
||
| #### Asynchronous Custom Constraints |
There was a problem hiding this comment.
@Fdawgs Do you have time to helps me check the document changes?
There was a problem hiding this comment.
Sorry @climba03003, missed this. Will take a look next week.
| 'Content-Type': 'application/json', | ||
| 'Content-Length': body.length | ||
| }) | ||
| res.end(body) |
There was a problem hiding this comment.
Did you evaluate res.destroy instead?
The only difference is whether or not emit an error from the request object. Can't recall any other differences
There was a problem hiding this comment.
Not quite understand what you means.
There was a problem hiding this comment.
I needed to refresh this
const { fastify } = require('fastify')
const app = fastify()
app.get('/destroy', async (request, reply) => {
reply.hijack()
reply.raw.destroy('hello world')
})
app.get('/end', async (request, reply) => {
reply.hijack()
reply.raw.end('hello world')
})
app.inject('/end', check)
.then(() => app.inject('/destroy', check))
function check (err, res) {
console.log(err)
console.log(res?.statusCode)
console.log(res?.payload)
}
There was a problem hiding this comment.
.destory cannot and will not send any payload to the client. Instead, it close the socket immediately.
.end return a proper error message to the client and they can deal with it other than just wait for browser socket timeout.
219de22 to
c7519ea
Compare
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Add support for async constraints
Checklist
npm run testandnpm run benchmarkand the Code of conduct