irmen / Pyro5

Pyro 5 - Python remote objects
https://pyro5.readthedocs.io
MIT License
303 stars 36 forks source link

httpgateway #54

Closed phil2nice closed 2 years ago

phil2nice commented 2 years ago

I suggest some modifications on pyro5 httpgateway in order to handle CORS Browsers Security Policy Http Method "OPTIONS" should be handled with following includings in response header

('Access-Control-Allow-Origin', pyro_app.cors), ('Access-Control-Allow-Methods', 'GET, POST, OPTIONS'), ('Access-Control-Allow-Headers', 'Content-Type')

pyro_app.cors will contain a parameter we could provide on a new launcher -C option. could be * to authorize every domain ou your specific Domain/URL

Once done, it's easy to have a Vuejs App calling to gateway to interact with pyro services proxies.

phil2nice commented 2 years ago

i will try to make a pull request it will be my ever first pull request :-)

irmen commented 2 years ago

Shouldn't those headers be returned with GET and POST methods as well?

phil2nice commented 2 years ago

Yes in the new code I put those headers for all http methods, it s easier to handle :-)

irmen commented 2 years ago

merged #55

irmen commented 2 years ago

closing this as it was merged. Thanks for the contribution.