Skip to content

Commit 5e7dbdc

Browse files
laurenceislasteve-chavez
authored andcommitted
fix: explain() always returning an error
It sends `for="application/json"` as media type by default, instead of `for="undefined"`.
1 parent 3816371 commit 5e7dbdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PostgrestTransformBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export default class PostgrestTransformBuilder<
267267
.filter(Boolean)
268268
.join('|')
269269
// An Accept header can carry multiple media types but postgrest-js always sends one
270-
const forMediatype = this.headers['Accept']
270+
const forMediatype = this.headers['Accept'] ?? 'application/json'
271271
this.headers[
272272
'Accept'
273273
] = `application/vnd.pgrst.plan+${format}; for="${forMediatype}"; options=${options};`

0 commit comments

Comments
 (0)