Skip to content

Commit

Permalink
Merge pull request #8 from iamarnavgarg/master
Browse files Browse the repository at this point in the history
ckanext- right-time-context cannot communicate with orion in same-domain
  • Loading branch information
aarranz committed Sep 12, 2018
2 parents b414246 + 94e7b7a commit f97934a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
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

0 comments on commit f97934a

Please sign in to comment.