Skip to content

[BUG] Silent errors on New() #89

@Br0nch1t3

Description

@Br0nch1t3

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Currently, the New function only returns a non-nil pointer to a SecureCookie even if an error occured, making it impossible to handle failure if a bad hash/block key is passed.

Expected Behavior

There should be a way to know if something went wrong

Possible solutions:

  1. Expose the err property of SecureCookie
  2. Have New return an error
  3. Return a nil pointer if an error occurs

Steps To Reproduce

s := securecookie.New(hashKey, []byte{}) // invalid block key

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions