英文:
Gorilla/Martini sessions not working in Cloud9 IDE environment
问题
我一直在Cloud9 IDE环境中尝试Go Web应用程序开发。到目前为止,我在使用Gorilla会话(也是Martini Web框架中会话的基本机制)方面没有成功。然而,在任何其他环境中,完全相同的代码确实可以成功运行。
要重现此问题,您可以从Martini会话附加组件的“Hello World”样式示例应用程序中复制并粘贴代码(请参见此处)。在这个简单的示例中,“/set” URL将一个值放入会话中,“/get” URL显示先前设置的值。
在Cloud9 IDE项目中,调用“/get” URL会将以下内容记录到控制台:
[martini] [sessions] ERROR! illegal base64 data at input byte 155
在尝试直接测试Gorilla时,我得到了类似的结果。然而,当在我的本地环境(或Nitrous.IO云环境)中运行完全相同的、未经修改的源代码时,它可以正常工作。
有没有人在Cloud9上进行Go Web开发,并对这个问题有什么见解?谢谢!
英文:
I've been experimenting with Go web application development in the Cloud9 IDE environment. So far I've had no success with using Gorilla sessions (which are also the underlying mechanism for sessions in the Martini web framework). However, the exact same code DOES work successfully in any other environment.
To reproduce the issue, you can cut-n-paste the exact "Hello World" style example app from the Martini sessions add-on (see here). In this simple example, the "/set" URL places a value on the session, and the "/get" URL displays the value that was previously set.
In a Cloud9 IDE project, calling the "/get" URL logs the following to the console:
[martini] [sessions] ERROR! illegal base64 data at input byte 155
I get similar results when trying to test Gorilla directly. However, when running any of this exact same source code, unmodified, in my local environment (or in a Nitrous.IO cloud environment), it works just fine.
Is anyone doing Go web development on Cloud9, and have any insights into this issue? Thanks!
答案1
得分: 1
我们(Cloud9)的应用程序代理没有正确编码所有的cookie。我们已经修复了这个问题,很快就会上线。
英文:
It turned out that our (Cloud9) application proxy does not encode all cookies properly. We have a fix for that, which should go live very soon.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论