Welcome to the Linux Foundation Forum!

Found a bug in Creating a Web Server with Fastify (7)

krave
krave Posts: 57
edited November 2022 in LFW212 Class Forum

Within the handler function of fastify.setNotFoundHandler(), if the method of the request object is not 'GET', reply.status(404) is not called. It results that if I access a url of http://localhost:3000/foo, I will get 200 status code which is not the expected behavior.

Comments

  • xdxmxc
    xdxmxc Posts: 81

    @krave sorry having trouble understanding, can you maybe show a code snippet to elaborate?

Categories

Upcoming Training