machawk1 / warcreate

Chrome extension to "Create WARC files from any webpage"
https://warcreate.com
MIT License
206 stars 13 forks source link

Response catching not working for certain headers #56

Closed diegito closed 10 years ago

diegito commented 10 years ago

I found that some headers do not have their response captured. This is because the HTTP headers are not case sensitive. They can be any case and still be legit.

Changed the checks made in warcGenerator.js with RegExps to possibly catch any case.

var jsregexp = new RegExp('content-type:[ ]*(text|application)/(javascript|js)','i');
        var imgregexp = new RegExp('content-type:[ ]*image/','i');
        var cssregexp = new RegExp('content-type:[ ]*text/(css|stylesheet)','i');
        var fontregexp = new RegExp('content-type:[ ]*font/','i');