Skip to content
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

Spiget sometimes returns express 404 page #24

Open
aft2d opened this issue Jun 5, 2020 · 3 comments
Open

Spiget sometimes returns express 404 page #24

aft2d opened this issue Jun 5, 2020 · 3 comments

Comments

@aft2d
Copy link

aft2d commented Jun 5, 2020

Sometimes the spiget API returns the default express 404 page.

Successful request:
image
image

404 request:
image
image

I first thought this might be related to a single API node (Identified by X-Spiget-Server header), but it occured on multiple API nodes (so far I've seen melon and aqua with this problem).

I was also able to reproduce this with different API endpoints. I was also able reproduce this with other clients e.g. curl

@aft2d
Copy link
Author

aft2d commented Jun 5, 2020

Okay, it's related to the fact that I'm sending POST requests.
GET /v2/resources/68517/ works fine.
So for these types of requests it's not really a problem, but still confusing why it's working sometimes and sometimes not :O

But for requests where POST is required (e.g. /v2/resources/68517/requestUpdate) this is really a problem.

Interesting is that if I'm sending "POST /v2/resources/68517/requestUpdate" I get the 404 page for "GET /v2/resources/68517/requestUpdate"
image

@InventivetalentDev
Copy link
Member

Well you generally need to respect request methods in REST APIs.
Spiget consists of 99% GET endpoints for stuff where you want to get data.
The only exceptions are endpoints where you modify data, e.g. POST /resources/:resource/requestUpdate, POST /webhook/register or DELETE /webhook/:id/:secret.

@InventivetalentDev
Copy link
Member

InventivetalentDev commented Jun 5, 2020

Though it is weird that you receive an error about GET on a POST request.
That actually does seem to be caused by different API hosts, since modification requests are always redirected to the master server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants