Meteor 公共目录中文件的显式 HTTP 响应标头 [英] Explicit HTTP Response Headers for files in Meteor's public directory
问题描述
我想为从我的 Meteor 应用程序中的 public
文件夹提供的文件设置自定义 HTTP 响应标头.
I'd like to set custom HTTP Response Headers on files served from the public
folder in my Meteor app.
WebApp.connectHandlers.use 如此处所述 不影响在公共文件夹中获取请求的回复中的标头(在 Meteor 0.8.1.3 中)
WebApp.connectHandlers.use as described here does not affect headers on the on replies to get requests within the public folder (in Meteor 0.8.1.3)
对公共文件夹的请求是否可以使用自定义标头?
Are custom headers possible for requests to the public folder?
推荐答案
查看 WebApp.rawConnectHandlers
;它们在为静态资产提供服务的 Meteor 连接处理程序之前运行.(见packages/webapp/webapp_server.js:259)
Check out WebApp.rawConnectHandlers
; they get run before the Meteor connect handler that serves the static assets. (See packages/webapp/webapp_server.js:259)
这篇关于Meteor 公共目录中文件的显式 HTTP 响应标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!