1

在哪里可以找到氚变量的完整列表(例如$host$path$content_type等)?

4

1 回答 1

3

您可以通过查看 tmp/messages/.../final-env.json 文件找到所有可访问的环境变量。

根据文档

所有可用的环境变量都列在 final-env.json 文件中。此文件可以在 {Moovweb 项目路径}/tmp/messages/{Folder ID} 目录中找到。要在 Tritium 中使用这些环境变量之一,您需要在其前面添加一个美元符号:$variable。

他们在那里提供了一个示例 final-env.json 文件:

{
 "0": "https://www.dropbox.com",
 "1": "https://www.dropbox.com",
 "2": "SAMEORIGIN",
 "3": "HTTP/1.0",
 "Content-Type-Charset": "UTF-8",
 "__catch_all__": ".moovapp.com",
 "accept_encoding": "gzip,deflate",
 "asset_host": "http://localhost:3003/",
 "body": "true",
 "body_length": "1195",
 "cache_control": "no-cache",
 "canonical_found": "false",
 "charset_determined": "UTF-8",
 "connection": "close",
 "content_type": "text/html; charset=utf-8",
 "cookie": "gvc=Mjg1NjE0NTk0MjAxMDUyNjY4MTc1NjYyMDE3OTAxNjU0NDk4NTc2",
 "date": "Fri, 07 Sep 2012 01:57:35 GMT",
 "device_stylesheet": "main",
 "found_conn": "true",
 "header_hh": "Host: ",
 "host": "mlocal.dropbox.com",
 "host_hh": "https://mlocal.dropbox.com",
 "key": "x_frame_options",
 "location": "https://www.dropbox.com/",
 "method": "GET",
 "path": "/",
 "pragma": "no-cache",
 "rewriter_url": "false",
 "secure": "false",
 "server": "nginx/1.0.14",
 "set_cookie": "flash=; Domain=dropbox.com; expires=Fri, 07-Sep-2012 01:57:35 GMT; Path=/; httponly",
 "slash_path": "/",
 "source_host": "www.dropbox.com",
 "status": "302",
 "use_global_replace_vars": "true",
 "user_agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.54.16 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1",
 "value": "SAMEORIGIN",
 "x_frame_options": "SAMEORIGIN"
}
于 2013-05-23T19:47:30.893 回答