当服务器以不同的值多次发送相同的 HTTP header 时,实现了哪个 HTTP header?
Which HTTP header is implemented when server sends same HTTP header multiple times with different values?
我发现了这个在 PHP 制作的网站。 access-control-allow-origin
header 重复三次。
我想知道如何处理此响应。后一个比前一个优先还是相反?或者两者具有同等意义?
总的来说:全部,以逗号分隔。见 https://greenbytes.de/tech/webdav/rfc7230.html#rfc.section.3.2.2:
A recipient MAY combine multiple header fields with the same field name into one "field-name: field-value" pair, without changing the semantics of the message, by appending each subsequent field value to the combined field value in order, separated by a comma. The order in which header fields with the same field name are received is therefore significant to the interpretation of the combined field value; a proxy MUST NOT change the order of these field values when forwarding a message.