Skip to content

Commit

Permalink
fix(storeURL): fix if statement for replacing special chars in store url
Browse files Browse the repository at this point in the history
  • Loading branch information
pcholuj committed Nov 21, 2018
1 parent 5f585a6 commit 41188ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/api/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export const storeURL = (
session.signature = security && security.signature || session.signature;

// replace url separators with _
if (opts.filename.indexOf(':') > -1) {
if (opts && opts.filename && opts.filename.indexOf(':') > -1) {
opts.filename = opts.filename.replace(/:/g, '_');
}

if (opts.filename.indexOf(',') > -1) {
if (opts && opts.filename && opts.filename.indexOf(',') > -1) {
opts.filename = opts.filename.replace(/,/g, '_');
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/api/upload/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ const uploadFile = async (ctx: Context, token: any): Promise<any> => {
const retry = (location: string, func: any, err: any, part?: PartObj): Promise<any> => {
let attempt = state.retries[location] || 0;

console.error(`Cannot upload file ${err}, Method: ${err.method}, Status: ${err.status}, Timeout: ${err.timeout}`);
// console.error(`Cannot upload file ${err}, Method: ${err.method}, Status: ${err.status}, Timeout: ${err.timeout}`);

const waitTime = Math.min(config.retryMaxTime, (config.retryFactor ** attempt) * 1000);
const promise = new Promise((resolve, reject) => {
Expand Down

0 comments on commit 41188ec

Please sign in to comment.