Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: "string" must be a string, Buffer, or ArrayBuffer at abortConnection #561

Closed
1 of 2 tasks
shapel opened this issue Sep 27, 2018 · 1 comment
Closed
1 of 2 tasks
Milestone

Comments

@shapel
Copy link
Contributor

shapel commented Sep 27, 2018

You want to:

  • report a bug
  • request a feature

Current behaviour

When you use allowRequest and pass error as number (like internal Server.errorMessages but in other range) system throw TypeError exception.

Steps to reproduce (if the current behaviour is a bug)

const server = io(httpServer, {
    allowRequest: (req, callback) {
      // do some checks
      callback(403, false);
    },
    path: '/socket.io'
  })

Expected behaviour

Do not throw exception.

Setup

  • OS:
  • browser:
  • engine.io version:

Other information (e.g. stacktraces, related issues, suggestions how to fix)

TypeError: "string" must be a string, Buffer, or ArrayBuffer\n    at Function.byteLength (buffer.js:481:11)\n    at abortConnection (\node_modules\engine.io\lib\server.js:507:25)\n    at \node_modules\engine.io\lib\server.js:354:7\n    at Server.allowRequest ```

@shapel
Copy link
Contributor Author

shapel commented Sep 27, 2018

#562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants