From fd7f81980348770eb3867215fc8bff20fe4a5382 Mon Sep 17 00:00:00 2001 From: Son NK Date: Thu, 28 Nov 2019 23:19:12 +0000 Subject: [PATCH] allow cross_origin for /api/alias/new --- app/api/views/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/views/index.py b/app/api/views/index.py index 40ae1ece..e5dd7e05 100644 --- a/app/api/views/index.py +++ b/app/api/views/index.py @@ -2,6 +2,7 @@ import random import arrow from flask import jsonify, request +from flask_cors import cross_origin from app.api.base import api_bp from app.config import EMAIL_DOMAIN @@ -12,6 +13,7 @@ from app.utils import random_string @api_bp.route("/alias/new", methods=["GET", "POST"]) +@cross_origin() def index(): """ the incoming request must provide a valid api-key in "Authentication" header and @@ -61,7 +63,7 @@ def index(): # check if email already exists. Very rare that an email is already used if GenEmail.get_by(email=full_email) or DeletedAlias.get_by( - email=full_email + email=full_email ): LOG.warning("full_email already used %s. Retry", full_email) else: