threefoldtecharchive / jumpscaleX_core

Apache License 2.0
1 stars 6 forks source link

enable_cors function needs to be reusable #153

Closed xmonader closed 4 years ago

xmonader commented 4 years ago
➜  threefoldtech ag "def enable_cors"
jumpscaleX_core/JumpscaleCore/servers/gevent_rack/ServerRack.py
86:            def enable_cors(fn):

jumpscaleX_core/JumpscaleCore/servers/gedis_http/GedisHTTPFactory.py
21:def enable_cors(fn):

jumpscaleX_threebot/ThreeBotPackages/zerobot/webinterface/bottle/BottleInterfaceFactory.py
14:def enable_cors(fn):

jumpscaleX_threebot/ThreeBotPackages/zerobot/chat/ChatFactory.py
25:def enable_cors(fn):

jumpscaleX_threebot/ThreeBotPackages/zerobot/wiki/BottleWebServerWiki.py
13:def enable_cors(fn):

Make enable_cors reusable instead of copying it

RafyAmgadBenjamin commented 4 years ago

The links which have cors:

abom commented 4 years ago

I think we can keep it here https://github.com/threefoldtech/jumpscaleX_core/blob/development/JumpscaleCore/servers/gedis_http/GedisHTTPFactory.py

And just import it in every other place.

abom commented 4 years ago

I thought of away to get a enable_cors decorator with optional allowed set of methods, but let's keep it for later.

RafyAmgadBenjamin commented 4 years ago

I have reused the enable_cors implemented in GedisHTTPFactory.py and imported it into the other files.

Pishoy commented 4 years ago

tested by Rafay