News for hackers. Stuff that matters.
Re:Username ending with MIME type format is not allowed by anentropic on Wednesday September 15, 2021 @06:58AM (#28537562)
Probably: some web frameworks do content negotiation by appending a content type like .json to the end of the url

Not sure if it's an attack vector per se, or just that the behaviour is incompatible with allowing usernames containing . and then having urls where the username is the last segment of the url

seems like a badly designed url scheme :)

Re:Username ending with MIME type format is not allowed by jfrunyon on Wednesday September 15, 2021 @07:17AM (#28537665)
> some web frameworks do content negotiation by appending a content type like .json to the end of the url

This has always disturbed me, considering that HTTP has had content negotiation for ... oh, basically its entire history [https://www.w3.org/Protocols/HTTP/1.0/spec.html#Accept].

Re:Username ending with MIME type format is not allowed by Macha on Wednesday September 15, 2021 @10:58AM (#28539980)
For non-programmatic usage and verification, the extensions can be easier?

On a similar topic HIBP allowed people to request versioning via a custom HTTP Header, a Accept Content-Type, or a version segment in the URL path and approximately everyone went with option 3.

Re:Username ending with MIME type format is not allowed by jfrunyon on Wednesday September 15, 2021 @11:47PM (#28547734)
"For non-programmatic usage and verification," it should be served in a human-readable manner, typically including things like formatting, and maybe even syntax coloring if you're feeling nice.

Take my `Accept: text/html` and give me my HTML-ified JSON, dangit! ;)

Re:Username ending with MIME type format is not allowed by Macha on Thursday September 16, 2021 @06:27AM (#28549971)
I've actually seen APIs with "pretty=true" or "indent=4" type query parameters to emit formatted JSON for people before, though it doesn't go as far as HTML with syntax colouring.
Re:Username ending with MIME type format is not allowed by gkop on Wednesday September 15, 2021 @10:37AM (#28539635)
Yes, the content negotiation you describe is a very longstanding default behavior of Rails. It should probably be made opt-in rather than opt-out in the next major version.