Skip to content

Commit c204760

Browse files
author
Your Name
committed
fix for ct value of wellknown core links pointing at OCF resources
1 parent 9229473 commit c204760

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/templates/CoAPthon3/ocfserver.py.jinja2

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class c{{path|variablesyntax}}Resource(Resource):
5959
observable=True, allow_children=True)
6060
self.payload = ""
6161
self.resource_type = "{{query_rt(json_data,path)}}"
62-
self.content_type = "text/plain"
62+
self.content_type = "application/vnd.ocf+cbor"
6363
interfaces_array = {{query_if(json_data, path)}}
6464
self.interface_type = str(interfaces_array[0]) + "," + str(interfaces_array[1])
6565
{%- for methodName, method_data in path_data.items() %}
@@ -176,7 +176,7 @@ class OICRESResource(Resource):
176176
self.value = 0
177177
self.payload = str(self.value)
178178
self.resource_type = "oic.wk.res {{device_type}}"
179-
self.content_type = "application/json" #application/cbor
179+
self.content_type = "application/vnd.ocf+cbor" #application/cbor
180180
self.interface_type = "oic.if.ll oic.if.baseline"
181181

182182
def render_GET_advanced(self, request, response):
@@ -270,7 +270,7 @@ class OICResource(Resource):
270270
self.value = 0
271271
self.payload = str(self.value)
272272
self.resource_type = ""
273-
self.content_type = "application/cbor" #application/cbor
273+
self.content_type = "application/vnd.ocf+cbor" #application/cbor
274274
self.interface_type = "oic.if.r" #, "oic.if.baseline"
275275

276276
def render_GET_advanced(self, request, response):
@@ -289,7 +289,7 @@ class OICSECResource(Resource):
289289
self.value = 0
290290
self.payload = str(self.value)
291291
self.resource_type = ""
292-
self.content_type = "application/cbor" #application/cbor
292+
self.content_type = "application/vnd.ocf+cbor" #application/cbor
293293
self.interface_type = "oic.if.r" #, "oic.if.baseline"
294294

295295
def render_GET_advanced(self, request, response):
@@ -309,7 +309,7 @@ class OICDResource(Resource):
309309
self.value = 0
310310
self.payload = str(self.value)
311311
self.resource_type = "oic.wk.d {{device_type}}"
312-
self.content_type = "application/cbor" #application/cbor
312+
self.content_type = "application/vnd.ocf+cbor" #application/cbor
313313
self.interface_type = "oic.if.r oic.if.baseline" #, "oic.if.baseline"
314314

315315
def render_GET_advanced(self, request, response):
@@ -365,7 +365,7 @@ class OICPResource(Resource):
365365
self.value = 0
366366
self.payload = str(self.value)
367367
self.resource_type = "oic.wk.p"
368-
self.content_type = "application/cbor" #application/cbor
368+
self.content_type = "application/vnd.ocf+cbor" #application/cbor
369369
self.interface_type = "oic.if.r" #, "oic.if.baseline"
370370

371371
def render_GET_advanced(self, request, response):
@@ -418,7 +418,7 @@ class introspectionResource(Resource):
418418
{ "content-type": "application/cbor", "protocol": "coap", "url": "/ifile"}] }
419419
self.payload = str(self.value)
420420
self.resource_type = "oic.wk.introspection"
421-
self.content_type = "application/cbor"
421+
self.content_type = "application/vnd.ocf+cbor"
422422
self.interface_type = "oic.if.r"
423423

424424
def render_GET_advanced(self, request, response):
@@ -453,7 +453,7 @@ class introspectionFileResource(Resource):
453453
observable=True, allow_children=False)
454454
self.payload = " illegal "
455455
self.resource_type = "oic.wk.introspection"
456-
self.content_type = "application/cbor"
456+
self.content_type = "application/vnd.ocf+cbor"
457457
self.interface_type = "oic.if.r"
458458

459459
def render_GET(self, request):
@@ -490,7 +490,7 @@ class OICDOXMResource(Resource):
490490
self.value = 0
491491
self.payload = str(self.value)
492492
self.resource_type = "oic.r.doxm"
493-
self.content_type = "application/cbor" #application/cbor
493+
self.content_type = "application/vnd.ocf+cbor" #application/cbor
494494
self.interface_type = "oic.if.rw" #, "oic.if.baseline"
495495

496496
def render_GET_advanced(self, request, response):

0 commit comments

Comments
 (0)