Skip to content

Commit

Permalink
fixed cors errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaaoBlues committed Jun 23, 2022
1 parent d86a2dc commit f5ead9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions copypasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0
app.config['TEMPLATES_AUTO_RELOAD'] = True
app.config['CORS_HEADERS'] = 'Content-Type'
CORS(app, support_credentials=True, resources={r"/": {"origins": "http://127.0.0.1:21987"}})
CORS(app, support_credentials=True, resources={r"/": {"origins": ["http://127.0.0.1:21987","http://copypasta.me"]}})

app.secret_key = "".join([choice(printable) for _ in range(256)])

Expand Down Expand Up @@ -92,7 +92,7 @@ def add_header(response):

#home
@app.route("/")
@cross_origin(origin='127.0.0.1',headers=['Content- Type','Authorization'])
@cross_origin()
def home():

if request.remote_addr == "127.0.0.1":
Expand Down Expand Up @@ -405,6 +405,7 @@ def process(process_id):
#api url(s)

@app.route("/api/<api_req>")
@cross_origin()
def api(api_req):

if request.remote_addr == "127.0.0.1":
Expand Down

0 comments on commit f5ead9f

Please sign in to comment.