Api-blueprint: 支持多个 HTTP 标头

创建于 2016-07-26  ·  3评论  ·  资料来源: apiaryio/api-blueprint

API Blueprint 似乎不允许多个 HTTP 标头。

根据RFC 2616 ,可以有多个 HTTP 标头。 RFC 7230使它更清楚:

   A sender MUST NOT generate multiple header fields with the same field
   name in a message unless either the entire field value for that
   header field is defined as a comma-separated list [i.e., #(values)]
   or the header field is a well-known exception (as noted below).

诸如PreferLink标题之类的内容通常显示在单独的行上以提高可读性。

API Blueprint 目前要求您将它们作为逗号分隔的列表显示在一行中(这已经足够了),但是通过允许它们写在单独的行上使其更易读是理想的。

谢谢!
: 礼帽:

Language Confirmed Bug

所有3条评论

为完整起见,解析器“容忍” Set-CookieLink标头。 问题是:

  1. 保留可以多次出现的header白名单
  2. 完全删除此警告

似乎我和@BigBlueHat准备完全消除警告......

删除警告的优点是允许人们创建自己的自定义标题,这些标题可能被定义为具有逗号分隔的列表值。 很难知道未来,所以“对你从别人那里接受的东西要宽容。” :微笑:

此页面是否有帮助?
0 / 5 - 0 等级