Syntax for ETag?

前端 未结 4 883
滥情空心
滥情空心 2020-12-09 15:44

Redbot reports that my webpage has invalid header:

The ETag header\'s syntax isn\'t valid.

My headers are set to:



        
4条回答
  •  时光取名叫无心
    2020-12-09 16:19

    Try ETag: "4ae413bd". The value of an ETag must follow the ABNF form:

      entity-tag = [ weak ] opaque-tag
      weak       = "W/"
      opaque-tag = quoted-string
    
      quoted-string  = ( <"> *(qdtext | quoted-pair ) <"> )
      qdtext         = >
      quoted-pair    = "\" CHAR
      CHAR           = 
      TEXT           = 
      OCTET          = 
      LWS            = [CRLF] 1*( SP | HT )
      CTL            = 
      CRLF           = CR LF
      CR             = 
      LF             = 
      SP             = 
      HT             = 
    

    , which is basically ([wW]/)?"([^"]|\\")*" in regular regex.

    Note that both "\" and "/" are valid values for etags.

    References: section-14.19, section-3.11, section-2.2.

提交回复
热议问题