douza6300 2012-09-14 04:34 采纳率: 0%
浏览 60
已采纳

GAE GO-HTML模板和数据安全

When displaying a webpage through the use of html templates in Google App Engine Go application, does the passed data and/or raw template ever leave the App Engine, or just the final html output? For example, if I have a class

type Foo struct{
    Public string
    Secret string
}

and a template that only uses {{.Public}} argument, does the {{.Secret}} argument ever leave the App? Similarly, if there is a template that displays some special data if the {{.Secret}} argument is present through the use of {{if .Secret}}...{{end}}, is there any way to access that part of the html in any way when the {{.Secret}} argument is not present?

  • 写回答

1条回答 默认 最新

  • duanqinjiao5244 2012-09-14 11:00
    关注

    It's your Go program that parses the template. This can take place on several GAE server instances. Assuming that leaving GAE means being sent over an HTTP/S connection over the public internet, then no - the output you send is the parsed HTML template.

    It's not possible to access the part after {{if .Secret}} if it's not included in the final HTML that the client receives.

    What you could do, however, would be to send the template and it's associated dataset encoded as gob or JSON over to your client, and let your client parse the template.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?
  • ¥15 关于#vue.js#的问题:修改用户信息功能图片无法回显,数据库中只存了一张图片(相关搜索:字符串)
  • ¥15 texstudio的问题,
  • ¥15 spaceclaim模型变灰色
  • ¥15 求一份华为esight平台V300R009C00SPC200这个型号的api接口文档
  • ¥15 字符串比较代码的漏洞
  • ¥15 欧拉系统opt目录空间使用100%
  • ¥15 ul做导航栏格式不对怎么改?