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

fix signature validation #26

Merged
merged 2 commits into from
Sep 15, 2017

Conversation

musou1500
Copy link
Contributor

Resolve #25

@musou1500
Copy link
Contributor Author

I signed the ICLA.

Copy link

@hatashiro hatashiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR! I've left a comment.

@@ -22,7 +22,7 @@ export default function middleware(config: Line.Config & Line.MiddlewareConfig):
const signature = req.headers["x-line-signature"] as string;

if (!signature) {
next();
next(new SignatureValidationFailed("no signature", signature));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signature here may be undefined, so it is not really meaningful to pass it. How about making public signature in SignatureValidationFailed optional and just not passing it?

constructor(
  message: string,
  public signature?: string,
) {

@musou1500
Copy link
Contributor Author

@noraesae thank you for your review. done.

@hatashiro
Copy link

Thanks. This change will be published with the next version, which is not yet specifically scheduled.

@hatashiro hatashiro merged commit b966568 into line:master Sep 15, 2017
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

Successfully merging this pull request may close these issues.

2 participants