mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 06:42:25 -06:00
[bugfix] Fix NegotiateAccept with multi accept
There's a bug in Gin's NegotiateFormat that doesn't handle the presence of multilpe accept headers. This lifts the code from the PR @tsmethurst sent a year ago to Gin into our codebase to fix the issue.
This commit is contained in:
parent
2478d83c84
commit
7050112af1
4 changed files with 122 additions and 3 deletions
|
|
@ -90,7 +90,7 @@ func (m *Module) threadGETHandler(c *gin.Context) {
|
|||
|
||||
// if we're getting an AP request on this endpoint we
|
||||
// should render the status's AP representation instead
|
||||
accept := c.NegotiateFormat(string(apiutil.TextHTML), string(apiutil.AppActivityJSON), string(apiutil.AppActivityLDJSON))
|
||||
accept := apiutil.NegotiateFormat(c, string(apiutil.TextHTML), string(apiutil.AppActivityJSON), string(apiutil.AppActivityLDJSON))
|
||||
if accept == string(apiutil.AppActivityJSON) || accept == string(apiutil.AppActivityLDJSON) {
|
||||
m.returnAPStatus(ctx, c, username, statusID, accept)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue