summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-10-28 15:52:47 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-10-28 15:52:47 +0700
commit4fc52a5e56baa116268e4bbab2cf9a5c017fd0db (patch)
tree35717dc516ee8e5b662855c09c6e12adcea9de4a
parent8cd24b9dc748921ed80f1e5cc2f6f4acccffa086 (diff)
test add cors
-rw-r--r--indoteknik_api/controllers/api_v1/product.py2
-rw-r--r--indoteknik_api/controllers/controller.py5
2 files changed, 2 insertions, 5 deletions
diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py
index d8006873..15f75d98 100644
--- a/indoteknik_api/controllers/api_v1/product.py
+++ b/indoteknik_api/controllers/api_v1/product.py
@@ -84,7 +84,7 @@ class Product(controller.Controller):
return self.response(data)
- @http.route(prefix + 'product/<id>/similar', auth='public', methods=['GET'])
+ @http.route(prefix + 'product/<id>/similar', auth='public', methods=['GET'], cors="*")
def get_product_similar_by_id(self, **kw):
if not self.authenticate():
return self.response(code=401, description='Unauthorized')
diff --git a/indoteknik_api/controllers/controller.py b/indoteknik_api/controllers/controller.py
index f41983ca..c02f6b60 100644
--- a/indoteknik_api/controllers/controller.py
+++ b/indoteknik_api/controllers/controller.py
@@ -50,10 +50,7 @@ class Controller(http.Controller):
response.update({'result': data})
response = json.dumps(response)
- return request.make_response(response, [
- ('Content-Type', 'application/json'),
- ('Access-Control-Allow-Origin', '*')
- ])
+ return request.make_response(response, [('Content-Type', 'application/json')])
def search_filter(self, model: str, kw: dict, query: array = []):
""" To search data by default API Params if exist """