There are plenty of HTTP verbs, but GET is the one most likely to be sent, e.g. by a user poking around with a browser.
Maybe this should send back an error string along with the code, I don't know. I'll think about it before merging.
(PS @grahams, I do this a lot: open PRs on my own repos for stuff I'm working on. Doesn't necessarily mean it's merge-ready, but it helps remind me what I'm working on. I don't do it for other people's repos because it can messy from the maintainers' PoV… 😆 )
I'm happy with the default message that comes with res.sendStatus(405). Somewhere I have a trivial implementation of a custom message, but meh, it seems unnecessary.
There are plenty of HTTP verbs, but GET is the one most likely to be sent, e.g. by a user poking around with a browser.
Maybe this should send back an error string along with the code, I don't know. I'll think about it before merging.
(PS @grahams, I do this a lot: open PRs on my own repos for stuff I'm working on. Doesn't necessarily mean it's merge-ready, but it helps remind me what I'm working on. I don't do it for other people's repos because it can messy from the maintainers' PoV… 😆 )