johno / ember-cli-gravatar

An Ember component for gravatar image tags
MIT License
45 stars 24 forks source link

has-gravatar helper not working #56

Open Navaneeth-pk opened 7 years ago

Navaneeth-pk commented 7 years ago

Console logs an OPTIONS request to gravatar which responds with a 405.

'has' always returns true.

rafaltrojanowski commented 7 years ago

Honestly, I couldn't reproduce 405, but on production server I noticed that requests have blocked mixed content status because they go via http. Seems default secure=true introduced here: https://github.com/johnotander/ember-cli-gravatar/blob/4901e1196be78b9070d993ec4eb7dfef2d3d1056/CHANGELOG.md#300---4152015 is not working in the service.

Fix: #57

ping @Navaneeth-pk, did this solve your problem?

Navaneeth-pk commented 7 years ago

@rafaltrojanowski Tried secure=true but am still getting this error

XMLHttpRequest cannot load https://www.gravatar.com/avatar/1aedb8d9dc4751e229a335e371db8058?d=404. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://dev-app.my-ember-app.com:4200' is therefore not allowed access.

Navaneeth-pk commented 7 years ago

gravatar is working, the problem is only while am using has-gravatar helper.

{{#has-gravatar email='test@gmail.com' as |g|}} {{#if g.has}} {{g.image}} {{else}} No gravatar found! {{/if}} {{/has-gravatar}}

Due to this error, helper always says 'has' is true.