405 After deploying aspnet project
I have an aspnetcore-based web-api.
Locally it works fine, even if i build and run it with docker.
But on railway, when i try to access the api through generated domain, i receive 405 on existing endpoints and 404 on non-existing ones.
An example of such endpoint would be POST example.com/auth/sign-in , to wich i pass json body with user creds
5 Replies
Project ID:
d9584449-f807-4d25-b807-f765ae62e699
d9584449-f807-4d25-b807-f765ae62e699
Wow, this is too obscure. A PATCH /game/{id} endpoint, which requires authorization somehow always returns 200 OK, even if i remove "Authorization" header in Postman.
And that's not an issue with code, because locally (running in docker container or running on the machine) it works alright!
By "alright" i mean that i receive 401 if jwt is broken or "Authorization" header is missing.
My though was that railway somehow got an older version of my code, but i implemented authorization in one commit. So there's either version with POST /auth/sign-in or without, and there are no other endpoints with the same route but different method.
you aren't using https when making these requests
Oh wow, thanks! That's really it
Yet i still don't get it about receiving 200 on authorization requiring method. What could be the cause of that?
I would normally offer to take a look, but I do not know anything about that language, however I'm confident it is a code issue and not necessarily a problem with railway