bitinn
V2EX  ›  Node.js

doc-sniff,解决请求返回不正确 content-type 的 node.js 库

  •  
  •   bitinn · Jan 30, 2015 · 2633 views
    This topic created in 4146 days ago, the information mentioned may be changed or developed.

    专职分辨日常抓取的html/xml,因为不方便用后缀名和magic number猜;现实简化的whatwg mimesniff spec算法。

    不过这个算法到底有多准我还不确定,欢迎大家找实际案例帮忙测试。这种代码应该是很常写的,但是大家遇到的变态页面情况都不同,希望通过协作找到适合99.99%案例的算法。

    https://github.com/bitinn/doc-sniff

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3095 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:49 · PVG 21:49 · LAX 06:49 · JFK 09:49
    ♥ Do have faith in what you're doing.