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

ckanext- right-time-context cannot communicate with orion in same-domain #8

Merged
merged 3 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ckanext/right_time_context/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ProxyNGSIController(base.BaseController):

def _proxy_query_resource(self, resource, parsed_url, headers, verify=True):

if parsed_url.path.find('/v1/queryContext') != -1:
if parsed_url.path.lower().find('/v1/querycontext') != -1:
if resource.get("payload", "").strip() == "":
details = 'Please add a payload to complete the query.'
base.abort(409, detail=details)
Expand Down
5 changes: 2 additions & 3 deletions ckanext/right_time_context/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


def check_query(resource):
parsedurl = resource['url']
parsedurl = resource['url'].lower()
return parsedurl.find('/v2/entities') != -1 or parsedurl.find('/v1/querycontext') != -1 or parsedurl.find('/v1/contextentities/') != -1


Expand Down Expand Up @@ -140,8 +140,7 @@ def setup_template_variables(self, context, data_dict):
view_enable = [False, details]
url = ''
else:
if not same_domain:
url = self.get_proxified_ngsi_url(data_dict)
url = self.get_proxified_ngsi_url(data_dict)

if resource['auth_type'] != 'none' and not p.toolkit.c.user:
details = "</br></br>In order to see this resource properly, you need to be logged in.</br></br></br>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ <h3 class="ngsiview-input hidden">NGSI Extra</h3>
}
}

if (url.pathname.indexOf('/v1/queryContext') !== -1) {
if (url.pathname.toLowerCase().indexOf('/v1/querycontext') !== -1) {
$('.ngsiview-v1').removeClass('hidden');
} else {
$('.ngsiview-v1').addClass('hidden');
Expand Down