Skip to content

Conversation

bryantson
Copy link

The current application fails to start with go run . with a following error: failed to validate payload signature: asn1: syntax error: sequence truncated.

After some debugging, the error happens to due to sig value in the line sig := r.Header.Get("GitHub-Public-Key-Signature") of service.go file's ChatCompletion function returning nothing.

This happened because the header changed from GitHub-Public-Key-Signature to X-GitHub-Public-Key-Signature as seen here:

https://docs.github.com/en/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github#verifying-that-payloads-are-coming-from-github

The current application fails to start with "go run ." with a following error: "failed to validate payload signature: asn1: syntax error: sequence truncated." After some debugging, the error happens to due to "sig" value in the line of "sig := r.Header.Get("GitHub-Public-Key-Signature")" of "service.go" file's "ChatCompletion" function returning nothing. This happened because the header changed from "GitHub-Public-Key-Signature" to "XGitHub-Public-Key-Signature" as seen here: 
https://docs.github.com/en/copilot/building-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/configuring-your-copilot-agent-to-communicate-with-github#verifying-that-payloads-are-coming-from-github
@matthiasT-13
Copy link

Second this. I also independently identified this fix.

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