如果出现 404 页面,如何使 Firebase 托管以 404 状态代码响应

时间:2021-01-18 19:29:52

标签: firebase firebase-hosting

有人知道如何让 Firebase 托管在 404 页面上发送 404 状态代码吗?

尝试了所有这些方法,到目前为止都没有奏效:

{
        "source": "404",
        "headers": [
          {
            "type": 404
          }
        ]
      }
{
        "source": "404",
        "headers": [
          {
            "key": "status",
            "value": "404"
          }
        ]
      }
{
        "source": "/404.html",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "max-age=2592000"
          },
          {
            "key": "status",
            "value": "404",
            "type": 404
          }
        ]
      },
      {
        "source": "/404",
        "headers": [
          {
            "key": "status",
            "value": "404",
            "type": 404
          }
        ]
      }

如果有人知道如何让 Firebase 发送 404 响应而不是 200,那就太好了!

0 个答案:

没有答案
相关问题