File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,15 @@ function process_link(current) {
116
116
}
117
117
118
118
var page_url = url . parse ( current ) ;
119
-
120
- // Add a slash if the path is not a file (does not end in a slash and does not have a dot)
121
- var components = page_url . path . split ( "/" ) ;
122
- if ( ! page_url . path . match ( / \/ $ / ) && ! components [ components . length - 1 ] . match ( / \. / ) ) {
123
- page_url . path += "/" ;
119
+ if ( response . headers [ 'content-type' ] && response . headers [ 'content-type' ] . match ( / i m a g e / ) ) {
120
+ console . log ( "not making this a directory: " + response . headers [ 'content-type' ] )
121
+ } else {
122
+ // Add a slash if the path is not a file (does not end in a slash and does not have a dot)
123
+ var components = page_url . path . split ( "/" ) ;
124
+ if ( ! page_url . path . match ( / \/ $ / ) && ! components [ components . length - 1 ] . match ( / \. / ) ) {
125
+ page_url . path += "/" ;
126
+ }
124
127
}
125
-
126
128
// Add "index.html" if the path ends in a slash
127
129
if ( page_url . path . match ( / \/ $ / ) ) {
128
130
page_url . path += "index.html" ;
@@ -158,6 +160,10 @@ function process_link(current) {
158
160
} ) ;
159
161
} else if ( response . headers [ 'content-type' ] && response . headers [ 'content-type' ] . match ( / j a v a s c r i p t / ) ) {
160
162
163
+ } else if ( response . headers [ 'content-type' ] && response . headers [ 'content-type' ] . match ( / z i p / ) ) {
164
+
165
+ } else if ( response . headers [ 'content-type' ] && response . headers [ 'content-type' ] . match ( / p d f / ) ) {
166
+
161
167
} else {
162
168
// assume HTML if it's not JS or CSS
163
169
var links = $ ( "a" ) ;
You can’t perform that action at this time.
0 commit comments