BUGFIX: Content-Type, Nil Raw Body Edge Case, Links

FIXES:
* There was an edge case where a raw body for HTML would potentially
  result in a nil byte slice exception. This has been fixed.
  (I don't even know if it was possible, I just made sure it wasn't.)
* The links browser is now explicitly returned as HTML and properly
  detected as a "browser".
* Hyperlinks for links, w3m added to Usage page.
* Content-Type is now always set correctly; there were cases where it
  was improperly returning e.g. text/plain for JSON.
This commit is contained in:
brent saner
2024-12-19 02:27:53 -05:00
parent 8a0465a0f4
commit 6b75e17f48
5 changed files with 55 additions and 6 deletions

View File

@@ -79,10 +79,15 @@ var (
mediaJSON: json.MarshalIndent,
mediaXML: xml.MarshalIndent,
}
// valid MIMEs.
okAcceptMime []string = []string{
mediaJSON,
mediaXML,
mediaYAML,
mediaHTML,
}
// These are actually HTML.
htmlOverride map[string]bool = map[string]bool{
"Links": true,
}
)