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

Bikeshed returning HTTP 405 Method Not Allowed #148

Closed
apasel422 opened this issue Feb 2, 2024 · 11 comments · Fixed by #150
Closed

Bikeshed returning HTTP 405 Method Not Allowed #148

apasel422 opened this issue Feb 2, 2024 · 11 comments · Fixed by #150

Comments

@apasel422
Copy link

See WICG/attribution-reporting-api#1154, which has the error output:

<p class='error'>Must use POST to process URL</p>
@tobie
Copy link
Owner

tobie commented Feb 2, 2024

@plinss any idea what’s going here? This seems to be happening across repositories.

@plinss
Copy link

plinss commented Feb 2, 2024

Yeah, the Bikeshed API service has been getting slammed with bogus requests (1-2 per second) from a bunch of crawlers (several hundred differed IPs all over the world) passing somewhat random URLs to be processed.

I made a few changes:

  1. any passed URL must have hosts on an allow list of domains (currently the CSSWG servers, GitHub, and W3C)
  2. all requests must be made via POST (as all the crawlers are doing GETs)

All the examples we've ever published using CURL are doing POSTs so this seemed a safe option, but I didn't realize pr-preview was doing a GET. Sorry for the bother.

If it's too much bother to change to using a POST I can find some other way of allowing pr-preview.

BTW, it would also be helpful if you could send a distinct UA string.

tobie added a commit that referenced this issue Feb 3, 2024
@tobie tobie closed this as completed in #150 Feb 3, 2024
tobie added a commit that referenced this issue Feb 3, 2024
@tobie
Copy link
Owner

tobie commented Feb 3, 2024

Should now be fixed. You'll have to slightly edit the PR's body to kickstart a new build.

@tobie tobie reopened this Feb 3, 2024
@tobie
Copy link
Owner

tobie commented Feb 3, 2024

OK, so I don't think that has fixed it.

@plinss: I suspect that you need the query as part of the body of the request and not in the URL. How do you need it formatted?

@plinss
Copy link

plinss commented Feb 3, 2024

Query arguments in the URL are fine (tested and verified), as are form data in the body either urlencoded or multipart (or any combination of query arguments and form data). Are you still seeing a 405 error or something else? Can you point me to logs of the error you're still seeing?

(Also a pr-preview specific UA string would help me find your requests in my logs.)

Note that I don't think #149 is a duplicate of this issue as that seems to be related to Spec Generator and not Bikeshed. It also refers to a 502 error.

@tobie
Copy link
Owner

tobie commented Feb 3, 2024

Note that I don't think #149 is a duplicate of this issue as that seems to be related to Spec Generator and not Bikeshed. It also refers to a 502 error.

Oh!!! Thanks. I had totally missed that. (Currently at FOSDEM where I'm presenting + helping run a workshop, so the timing is less than ideal. :D)

@plinss
Copy link

plinss commented Feb 3, 2024

NP, I also noticed that you may be sending the HTTP method in lower case and I'm doing a case-sensitive test (I'm not sure offhand if your client or my server is normalizing that or not). I made the test for POST be case-insensitive in case that helps.

@tobie
Copy link
Owner

tobie commented Feb 3, 2024

@plinss thank you. upper-case the method + added a User-Agent header in bd4c8a4. Overall though, you're right and I think the problem is now with Spec Generator. @dontcallmedom / @tidoust, any idea what's up and can you help?

@dontcallmedom
Copy link

paging @deniak on the Spec Generator

@deniak
Copy link
Contributor

deniak commented Feb 5, 2024

Indeed, there was an issue with spec-generator for document hosted on raw.githubusercontent.com. This is now fixed.
Thank you for the report.

@tobie
Copy link
Owner

tobie commented Feb 5, 2024

Awesome. It seems everything should be back to normal, then. Closing.

@tobie tobie closed this as completed Feb 5, 2024
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

Successfully merging a pull request may close this issue.

5 participants