html 如何设置p3p,internet explorer - Set P3P code in HTML - Stack Overflow

I've encountered the same issue recently trying to serve static HTML from AWS S3.

Unfortunately, it is not possible to set Compact Policies without sending server-side response headers.

This means that you cannot set a Compact Policy on staticly-served HTML content.

There is only one mechanism for sites to serve compact policies; they are sent as HTTP response headers. Thus, if a site is unable or unwilling to add HTTP response headers, compact policies cannot be used.

The HTML element META with the http-equiv attribute is sometimes used to simulate the effect of adding HTTP headers to HTML content. ... the http-equiv mechanism should not be used to send a P3P compact policy header, as this information may not be available to a client until after it has processed the cookies in the response.

The and elements cannot set the Compact Policy either - it must be a response header.

The bottom line is this:

Are you able to send the p3p response header?

Yes: Add the header with the appropriate policy and you are done.

No: You are out of luck and are unable to set a Compact Policy.

For Amazon S3:

The p3p header is considered a user-defined key so it can only be added as x-amz-meta-p3p.

Since x-amz-meta-p3p != p3p the browser will not accept it as the correct header.

Therefore you cannot set a Compact Policy on AWS S3 content.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值