【问题标题】:how to remove the powered by Sailsjs from the app如何从应用程序中删除由 Sailsjs 提供支持
【发布时间】:2014-11-14 11:31:06
【问题描述】:

我知道文件存在这里

Linkto the file

但是有没有一种有效的方法来删除这个标题?就像在配置文件中一样?

请看这个标题

Access-Control-Allow-Origin →*
Connection →Keep-Alive
Content-Encoding →gzip
Content-Length →1189
Content-Type →text/html; charset=utf-8
Date →Fri, 19 Sep 2014 20:30:24 GMT
ETag →"-514643591-gzip"
Keep-Alive →timeout=5, max=200
Server →Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.4 OpenSSL/1.0.1f
Vary →Accept-Encoding
X-Powered-By →Sails <sailsjs.org>

我想删除这个 X-Powered-by

谢谢

【问题讨论】:

  • 请在此处发布您的代码。
  • 什么???我这边没有要发布的代码。这是一个需要知道答案的人来回答的问题。天哪
  • 我只是要求您发布导致问题的代码。如果我们看不到问题所在,我们就不可能猜出问题的答案。此外,您不能只添加指向某些代码的链接;该链接将来可能会被删除,人们不会点击随机链接等。
  • 没有问题。但我已经更新了这个问题,让标题看起来像什么。
  • // res.header('X-Powered-By', 'Sails '); github.com/balderdashy/sails/blob/master/lib/hooks/http/…

标签: javascript sails.js


【解决方案1】:

在您的 http.js 配置文件中,只需将带有 poweredBy 的行注释掉即可。

http://sailsjs.org/#/documentation/anatomy/myApp/config/http.js.html

【讨论】:

  • 我看不到这条线?它到底在哪里?你确定吗?
  • poweredBy: function xPoweredBy(req, res, next) { res.header('X-PowBy', 'Express');下一个(); }
猜你喜欢
  • 2017-09-28
  • 2013-06-05
  • 2013-08-18
  • 1970-01-01
  • 1970-01-01
  • 2014-08-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多