Skip to content

Enhancements #1

@tracker1

Description

@tracker1

If the intent is to really turn this into a backing service, should probably add the following.

  • Add CORS support (cross origin)
  • Size limit for body parser (5kb should be way more than enough), will prevent some flooding/injection attacks
  • Add error handler to return JSON, good for all API interfaces to return errors in the common format used by the API itself. Errors should return an object, with a single error property, with at least a code (corresponding to http status code, and message, containing error text, and optionally other error properties).
{ // single object response, with single property of "error"
  error: {
    code: 400 //invalid input, or 5xx for other errors
    ,message: error.message // original or custom error message
    ,...error // other properties from error, message is part of inheritance and doesn't serialize
  }
}

Possible value-adds:

  • Wrap zxcvbn request processing into a pool limited to PROCESSOR_COUNT instances, so that you can avert some flooding scenarios.
  • Add xdomain proxy.html so that xdomain can be used with old IE in order to use the service.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions