pfnet / PaintsChainer

line drawing colorization using chainer
https://paintschainer.preferred.tech/
MIT License
3.77k stars 557 forks source link

Public server occasionally return 502 while coloring #68

Open 6DammK9 opened 7 years ago

6DammK9 commented 7 years ago

XMLHttpRequest cannot load http://paintschainer1.preferred.tech/post. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://paintschainer.preferred.tech' is therefore not allowed access. The response had HTTP status code 502. Failed to load resource: the server responded with a status of 502 (Bad Gateway) ... I know nothing about the public server so I can't say it is just a typo. PS: Chrome 56 from a office PC.

6DammK9 commented 7 years ago

If it is just minor problems about setting the server (nginx?), I will close the issue. 502 disappeared by no reason.

taizan commented 7 years ago

yes it sometimes occurring, and some of them was our bug. I thought it was solved... I ll check it again

caoli5288 commented 7 years ago

Still bugy.

taizan commented 7 years ago

I found that one of the server is problem and solved it now but still I dont know why...

abbychau commented 7 years ago

paintschainer1.preferred.tech should not be the one returning for requests from http://**paintschainer**.preferred.tech

self.send_header("Access-Control-Allow-Origin", "*")

this should work if the program is both loaded from paintschainer1 and paintschainer though :)

is there some upstream server settings mismatches? @taizan

taizan commented 7 years ago

hmm we allowing CROS with self.send_header("Access-Control-Allow-Origin", "*") but in paintschainer1, it is not working in some of browsers maybe because paintschainer1 equals paintschainer root....?

6DammK9 commented 7 years ago

Not sure what is exactly the host - server relationship, From my experience, it could be solved by Browser > Server 1 API > (Server 2 API > Server 2 return) > Server 1 return > Browser. Simple redirect + header will leads to CROS stuff (as "some browsers" managed to keep track the requesting link). But this could be tedious to code. Maybe there are better solutions? PS: Want to join slack: 6DammK9@gmail.com