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

说明文档中的请求示例可能有误 #1

Open
wsndshx opened this issue Aug 9, 2021 · 0 comments
Open

说明文档中的请求示例可能有误 #1

wsndshx opened this issue Aug 9, 2021 · 0 comments

Comments

@wsndshx
Copy link

wsndshx commented Aug 9, 2021

问题描述

在进行注册操作时, 若按照API文档中的示例

{
  "message":"-----BEGIN PGP SIGNED MESSAGE-----\nserver_name: Some server\n-----BEGIN PGP SIGNATURE...",
  "public_key":"-----BEGIN PGP PUBLIC KEY-----..."
}

在程序中使用下面的方法拼接请求内容

"-----BEGIN PGP SIGNED MESSAGE-----\nserver_name: " + server_name + "\n" + message

将会返回以下错误

image

Error: Mandatory blank line missing between armor headers and armor data
    at /home/mprdb/OpenMPRDB/node_modules/openpgp/dist/node/openpgp.min.js:2:25843
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

在标题下加多一个换行符后解决

"-----BEGIN PGP SIGNED MESSAGE-----\n\nserver_name: " + server_name + "\n" + message

开发环境

OS: Microsoft Windows 10.0.19043

Languages: Golang

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

1 participant