-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No response when payload is large #4482
Labels
bug
Bug or defect
Comments
@cariolet I tried this on Node 16 / Hapi 21.3.3: import { Server } from '@hapi/hapi';
import Boom from '@hapi/boom';
const server = new Server({
port: 3000,
host: 'localhost',
});
server.auth.scheme('custom', () => ({
authenticate: (request, h) => {
return h.unauthenticated(
Boom.unauthorized()
)
}
}));
server.auth.strategy('custom', 'custom');
server.route({
method: 'POST',
path: '/',
handler: (request, h) => {
return 'Hello World!';
},
options: {
auth: 'custom',
payload: {
output: 'stream',
parse: true,
allow: 'application/json',
maxBytes: 10 * 1024 * 1024
}
}
});
const init = async () => {
await server.start();
console.log(`Server running on ${server.info.uri}`);
};
init(); and I get the following response: curl localhost:3000 -d '{ "hello": true }'
{"statusCode":401,"error":"Unauthorized","message":"Unauthorized"} And using Could you give a more complete example? |
Hi, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Runtime
node.js
Runtime version
16.18.1
Module version
21.3.3
Last module version without issue
No response
Used with
No response
Any other relevant information
No response
What are you trying to achieve or the steps to reproduce?
Below is the hapi server code to reproduce the error
What was the result you got?
If the defined strategy returns an unauthorized route error, a "no response" is returned to the client
What result did you expect?
I expect it to return error 401
The text was updated successfully, but these errors were encountered: