Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 67c350b

Browse files
default to any since server also serves markdown
1 parent bfdb9e8 commit 67c350b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/SqlStreamStoreBrowser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const onNavigate = (link, authorization) =>
4949

5050
const initialNavigation = ({ authorization }) =>
5151
onNavigate(
52-
{ href: window.location.href, type: mediaTypes.hal },
52+
{ href: window.location.href, type: mediaTypes.any },
5353
authorization,
5454
);
5555

src/utils/http.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const mapResponse = async (response: Response): Promise<HttpResponse> => {
5555
const get = ({ link, headers = {} }: HttpRequest) =>
5656
fetch(link.href, {
5757
headers: new Headers({
58-
accept: link.type || mediaTypes.hal,
58+
accept: link.type || mediaTypes.any,
5959
...headers,
6060
}),
6161
}).then(mapResponse);
@@ -72,7 +72,7 @@ const post = <TRequest extends object, TResponse extends object>({
7272
fetch(link.href, {
7373
body: JSON.stringify(body),
7474
headers: new Headers({
75-
accept: link.type || mediaTypes.hal,
75+
accept: link.type || mediaTypes.any,
7676
'content-type': mediaTypes.json,
7777
...headers,
7878
}),
@@ -82,7 +82,7 @@ const post = <TRequest extends object, TResponse extends object>({
8282
const _delete = ({ link, headers = {} }: HttpRequest) =>
8383
fetch(link.href, {
8484
headers: new Headers({
85-
accept: link.type || mediaTypes.hal,
85+
accept: link.type || mediaTypes.any,
8686
...headers,
8787
}),
8888
method: 'delete',

src/utils/mediaTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const mediaTypes = {
2+
any: '*/*',
23
hal: 'application/hal+json',
34
json: 'application/json',
45
markdown: 'text/markdown',

0 commit comments

Comments
 (0)