Disclaimer: I'm new to Java, Spring, and Spring Boot.

I'd like to have Spring Boot return a 404 when trying to POST to a URL that doesn't exist. However, right now it's returning a 405, with an Allow header that only includes GET and HEAD. Is there a way to customize which HTTP methods are allowed so that I get a 404? I've tried implementing a custom ErrorController, but that doesn't seem to work.

**To be clear**: this is when I'm POSTing to a URL that shouldn't be matched by *any* of my defined endpoints, e.g <http://example.com/some-bogus-thing>

If any more information is needed to diagnose this, I'd be happy to provide it. Given my unfamiliarity with the platform, I'm not sure what's relevant.