Skip to content

Commit

Permalink
fixup! feat!: improve file client implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Nov 29, 2023
1 parent 3aee0ca commit 0780ba4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/binding-file/src/file-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export default class FileClient implements ProtocolClient {

public async readResource(form: Form): Promise<Content> {
const filePath = fileURLToPath(form.href);
const contentType = form.contentType ?? ContentSerdes.DEFAULT;

const formContentType = form.contentType;
if (form.contentType == null) {
debug(`Found no Content-Type for Form, defaulting to ${ContentSerdes.DEFAULT}`);
}
const contentType = formContentType ?? ContentSerdes.DEFAULT;

return this.readFromFile(filePath, contentType);
}
Expand Down

0 comments on commit 0780ba4

Please sign in to comment.