Skip to content

Commit

Permalink
fix(upload): add signature and policy to complete upload event (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcholuj authored Oct 23, 2018
1 parent ee1d090 commit 7d98a27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/api/upload/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,20 @@ export const complete = (etags: string, { config, file, params }: Context): Prom
fields.multipart = true;
delete fields.parts;
}

// Security
if (config.policy && config.signature) {
fields.policy = config.policy;
fields.signature = config.signature;
}

const formData = getFormData(fields, config);
const req = requestWithSource('post', `${host}/multipart/complete`);
/* istanbul ignore next */
if (locationRegion) {
req.set('Filestack-Upload-Region', locationRegion);
}
req.timeout(config.timeout);

return req.field(formData);
};

0 comments on commit 7d98a27

Please sign in to comment.