Code Monkey home page Code Monkey logo

Comments (4)

dcai avatar dcai commented on July 16, 2024

Seems you use an invalid access key, can you pull my commit see what will happen?

from airnotifier.

mouneyrac avatar mouneyrac commented on July 16, 2024

Yes it's what I said, I use an invalid key ;)

I currently have issue with creating token, so I tested my headers with some invalid access key and invalid appname to see what's happening. I discovered this issue.

On another subject:

I do think there is an issue that forbid to create token I always see self.send_response(dict(error="No permission to create token"))

Are you sure of

def post(self, devicetoken):
"""Create a new token
"""
if self.permission & 1 == 1:
self.send_response(dict(error="No permission to create token"))
return

Still debugging, my curl call is:

curl -i -H "Accept: application/json" -H "X-AN-APP-KEY: XXXXX...XXXX" -H "X-AN-APP-NAME: moodlehtml5app" -X POST http://notify.moodle.net:8801/tokens/847648764874678

It seems to me it's correct.

from airnotifier.

mouneyrac avatar mouneyrac commented on July 16, 2024

ok with invalid access key, the error message is now better :)

Little note: for making the client life easier it would be good to return errorcode too with the error msg. Example:
{"error": "Invalid access key", "errorcode": "badaccesskey"}

from airnotifier.

mouneyrac avatar mouneyrac commented on July 16, 2024

closing as the bug itself is fixed. Thanks dongsheng.

from airnotifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.