Skip to content

Commit

Permalink
fix storage upload for string (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
yevheniyJ authored Feb 11, 2023
1 parent 169c6c9 commit f0937bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@crowdin/crowdin-api-client",
"version": "1.21.1",
"version": "1.21.2",
"description": "JavaScript library for Crowdin API v2.",
"main": "out/index.js",
"types": "out/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/uploadStorage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@ export class UploadStorage extends CrowdinApi {
config.headers['Crowdin-API-FileName'] = this.encodeUrlParam(fileName);
if (contentType) {
config.headers['Content-Type'] = contentType;
} else if (typeof request === 'string') {
config.headers['Content-Type'] = 'text/plain';
} else {
const fileNameParts = fileName.split('.');
let contentType;
Expand Down

0 comments on commit f0937bc

Please sign in to comment.