Skip to content

Commit 8550150

Browse files
authored
fix(route/inspirehep): fix getAuthorById custom accept header (#17574)
1 parent c37d64c commit 8550150

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/routes/inspirehep/author.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ export const route: Route = {
1919
handler,
2020
};
2121

22-
export const getAuthorById = (id: string) => cache.tryGet(`inspirehep:author:${id}`, () => ofetch<AuthorResponse>(`${baseUrl}/api/authors/${id}`));
22+
export const getAuthorById = (id: string) =>
23+
cache.tryGet(`inspirehep:author:${id}`, () =>
24+
ofetch<AuthorResponse>(`${baseUrl}/api/authors/${id}`, {
25+
headers: {
26+
accept: 'application/vnd+inspire.record.ui+json',
27+
},
28+
parseResponse: JSON.parse,
29+
})
30+
);
2331

2432
async function handler(ctx) {
2533
const id = ctx.req.param('id');

0 commit comments

Comments
 (0)