File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,19 @@ function isPdfFile(details) {
73
73
var header = getHeaderFromHeaders ( details . responseHeaders , 'content-type' ) ;
74
74
if ( header ) {
75
75
var headerValue = header . value . toLowerCase ( ) . split ( ';' , 1 ) [ 0 ] . trim ( ) ;
76
- return ( headerValue === 'application/pdf' ||
77
- headerValue === 'application/octet-stream' &&
78
- details . url . toLowerCase ( ) . indexOf ( '.pdf' ) > 0 ) ;
76
+ if ( headerValue === 'application/pdf' ) {
77
+ return true ;
78
+ }
79
+ if ( headerValue === 'application/octet-stream' ) {
80
+ if ( details . url . toLowerCase ( ) . indexOf ( '.pdf' ) > 0 ) {
81
+ return true ;
82
+ }
83
+ var cdHeader =
84
+ getHeaderFromHeaders ( details . responseHeaders , 'content-disposition' ) ;
85
+ if ( cdHeader && / \. p d f ( [ " ' ] | $ ) / i. test ( cdHeader . value ) ) {
86
+ return true ;
87
+ }
88
+ }
79
89
}
80
90
}
81
91
You can’t perform that action at this time.
0 commit comments