Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGSIv2 subscribe does not support https in cbHost payload #680

Open
chicco785 opened this issue Oct 19, 2018 · 2 comments
Open

NGSIv2 subscribe does not support https in cbHost payload #680

chicco785 opened this issue Oct 19, 2018 · 2 comments

Comments

@chicco785
Copy link
Contributor

chicco785 commented Oct 19, 2018

current code is as follows:

   if (device.cbHost) {
        options.uri = 'http://' + device.cbHost + '/v2/subscriptions';
    } else {
        options.uri = config.getConfig().contextBroker.url + '/v2/subscriptions';
    }

while it should (probably) be:

    if (device.cbHost && device.cbHost.indexOf('://') !== -1) {
        options.uri = device.cbHost + '/v2/subscriptions';
    } else if (device.cbHost && device.cbHost.indexOf('://') === -1) {
        options.uri = 'http://' + device.cbHost + '/v2/subscriptions';
    } else {
        options.uri = config.getConfig().contextBroker.url + '/v2/subscriptions';
    }
@fgalan
Copy link
Member

fgalan commented Oct 23, 2018

Is this issue as spinf of for #593 ?

@chicco785
Copy link
Contributor Author

yep but for ngsiv2, i am fix it and adding tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants