Cannot link to BR in another format #95
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
According to
#94 (comment)
the BR is provided in multiple formats which are selected by accept header.
As headers cannot be specified in an URL it's not possible to link to results in different formats.
What is the usecase to linking to JSON or XML results where you cannot specify accept header?
I'll entertain a patch for this (eg. via GET parameter) if there's an actual, valid use-case here.
What is the use case for obfuscating the URLs?
Yes, in most cases (other than linking here for a bug report) the consumer of the JSON and XML will be automation that can specify headers.
However, it can equally specify a query string.
Selecting the content type by query string rather than headers makes the content unambiguous,
I am sure whoever designed this feels very clever about it.
I have seen a protocol specification built around this that made handling the protocol with the mime type infra pretty much impossible.
This is a small technical detail of the whole OBS so it probably does not cause serious problem if it's 'clever' in a stupid way.
Nonetheless, spreading examples of bad design is not great.
Yes, the specification allows this but not everything specifications allow is a good idea.
It's seemed to handle in the go library as alternative that popped in my head was file extensions and that is more messy.. And I've only had one case where someone wanted to use this and they don't complain about
Accept:header.The code is here if you need to improve it. The ParseMimeHeader could probably also handle query parameters without changing any rest of the code.
This is the type function.