通过代码向 Bugzilla 添加 bug
我正在使用类似浏览器的方法向 Bugzilla 添加错误。 我正在成功登录。当我添加错误时,我没有收到错误。我收到状态代码“OK”。但是,响应 html 包含以下内容:
Bugzilla – 可疑操作
“看起来您没有来自正确的页面(在处理“post_bug.cgi”脚本时,您没有有效的 create_bug 操作令牌)。原因可能是之一: 成功提交更改后,您单击了网络浏览器的“后退”按钮,这通常不是一个好主意(但无害)。 您直接在网络浏览器的地址栏中输入了 URL,这应该是安全的。 您在未经您同意的情况下点击了将您重定向到此处的 URL,在这种情况下,此操作更为重要。 您确定要提交这些更改吗?这可能会导致意外和不期望的结果。”
有一个确认按钮。
当我手动(而不是通过代码)执行此操作时,我不会收到错误页面。相反,我得到的响应是一切顺利,我可以得到我的 bug 的 id 。但是,由于我收到错误,该 id 是一个空字符串,如何解决这个问题
? ?
I'm using browser-like approach for adding a bug to Bugzilla.
I'm making a successful login. When I add the bug, I don't get error. I get status code OK. But, the response html contains this:
Bugzilla – Suspicious Action
"It looks like you didn't come from the right page (you have no valid token for the create_bug action while processing the 'post_bug.cgi' script). The reason could be one of:
You clicked the "Back" button of your web browser after having successfully submitted changes, which is generally not a good idea (but harmless).
You entered the URL in the address bar of your web browser directly, which should be safe.
You clicked on a URL which redirected you here without your consent, in which case this action is much more critical.
Are you sure you want to commit these changes anyway? This may result in unexpected and undesired results."
There is a confirm button.
When I do this by hand (not by code), I don't get the error page. Instead, I get response that everything went fine and I can get my bug's id. So, ahead in my code I'm using the id. However, because of the error I get, the id is an empty string. How to resolve this?
Can it be resolved by clicking on the confirm button by code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在脚本中使用 Bugzilla 的 REST API。
Bug 的创建记录在此处
You can use Bugzilla's REST API from your script.
Creation of a bug is documented here