You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2020/06/18 13:28:51 UTC
[GitHub] [openwhisk-package-kafka] rabbah commented on a change in pull request #370: Handle URL params gently
rabbah commented on a change in pull request #370:
URL: https://github.com/apache/openwhisk-package-kafka/pull/370#discussion_r442225044
##########
File path: action/lib/common.js
##########
@@ -98,7 +105,9 @@ function massageParamsForWeb(rawParams) {
}
function getWebActionURL(endpoint, actionName) {
- return `https://${endpoint}/api/v1/web/whisk.system/messagingWeb/${actionName}.http`;
+ var massagedAPIHost = addHTTPS(endpoint);
Review comment:
```suggestion
var apiHost = addHTTPS(endpoint);
```
##########
File path: action/lib/common.js
##########
@@ -26,14 +26,21 @@ function triggerComponents(triggerName) {
};
}
+function addHTTPS(url) {
+ if (!/^(?:f|ht)tps?\:\/\//.test(url)) {
Review comment:
i don't think `ftps` is relevant here - shouldn't this be only http or https?
##########
File path: action/lib/common.js
##########
@@ -98,7 +105,9 @@ function massageParamsForWeb(rawParams) {
}
function getWebActionURL(endpoint, actionName) {
- return `https://${endpoint}/api/v1/web/whisk.system/messagingWeb/${actionName}.http`;
+ var massagedAPIHost = addHTTPS(endpoint);
+
+ return `${massagedAPIHost}/api/v1/web/whisk.system/messagingWeb/${actionName}.http`;
Review comment:
```suggestion
return `${apiHost}/api/v1/web/whisk.system/messagingWeb/${actionName}`;
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org