format code

This commit is contained in:
6543 2022-11-12 00:32:32 +01:00
parent ba00db990b
commit cf78f5fda2
No known key found for this signature in database
GPG key ID: B8BE6D610E61C862

View file

@ -151,9 +151,7 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str
} }
} }
// now we are sure it's content // now we are sure it's content so set the MIME type
{
// Set the MIME type
mimeType := client.getMimeTypeByExtension(resource) mimeType := client.getMimeTypeByExtension(resource)
resp.Response.Header.Set(ContentTypeHeader, mimeType) resp.Response.Header.Set(ContentTypeHeader, mimeType)
@ -168,7 +166,6 @@ func (client *Client) ServeRawContent(targetOwner, targetRepo, ref, resource str
MimeType: mimeType, MimeType: mimeType,
} }
return fileResp.CreateCacheReader(reader, client.responseCache, cacheKey), resp.Response.Header, resp.StatusCode, nil return fileResp.CreateCacheReader(reader, client.responseCache, cacheKey), resp.Response.Header, resp.StatusCode, nil
}
case http.StatusNotFound: case http.StatusNotFound:
if err := client.responseCache.Set(cacheKey, FileResponse{ if err := client.responseCache.Set(cacheKey, FileResponse{