Skip to content

Commit e7ead13

Browse files
coco-supertanhe123
authored andcommitted
add HTTP trigger download tips (#731)
1 parent 208c114 commit e7ead13

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

lib/deploy/deploy-by-tpl.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,14 @@ async function deployTriggers(serviceName, functionName, events) {
8181
let onLineTriggerNames = await getTriggerNameList({serviceName, functionName});
8282

8383
onLineTriggerNames.filter(x =>!_.includes(localTriggerNames, x)).forEach(element => {
84-
8584
console.warn(red(`\t\tThe trigger ${element} you configured in fc console does not match the local configuration.\n\t\tFun will not modify this trigger. You can remove this trigger manually through fc console if necessary`));
86-
8785
});
8886

8987
for (const [triggerName, triggerDefinition] of Object.entries(events)) {
9088
console.log(`\t\tWaiting for ${yellow(triggerDefinition.Type)} trigger ${triggerName} to be deployed...`);
91-
9289
await deployTrigger(serviceName, functionName, triggerName, triggerDefinition);
93-
9490
await displayTriggerInfo(serviceName, functionName, triggerName, triggerDefinition.Type, triggerDefinition.Properties, '\t\t');
95-
96-
console.log(green(`\t\tfunction ${triggerName} deploy success`));
91+
console.log(green(`\t\ttrigger ${triggerName} deploy success`));
9792
}
9893
}
9994

lib/trigger.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ async function displayTriggerInfo(serviceName, functionName, triggerName, trigge
434434
console.log(`${resolveWrap}triggerName: ${yellow(triggerName)}`);
435435
}
436436
console.log(`${resolveWrap}methods: ${yellow(methods)}`);
437-
console.log(`${resolveWrap}url: ` + yellow(`https://${accountId}.${region}.fc.aliyuncs.com/2016-08-15/proxy/${serviceName}/${functionName}/\n`));
437+
console.log(`${resolveWrap}url: ` + yellow(`https://${accountId}.${region}.fc.aliyuncs.com/2016-08-15/proxy/${serviceName}/${functionName}/`));
438+
console.log(red(`${resolveWrap}Http Trigger will forcefully add a 'Content-Disposition: attachment' field to the response header, which cannot be overwritten \n${resolveWrap}and will cause the response to be downloaded as an attachment in the browser. This issue can be avoided by using CustomDomain.\n`));
438439
}
439440
}
440441

0 commit comments

Comments
 (0)