(url)
| 50 | |
| 51 | // Check if URL is a PDF based on Content-Type header |
| 52 | export async function isPdfUrl (url) { |
| 53 | try { |
| 54 | const response = await fetch(url, { method: 'HEAD' }) |
| 55 | const contentType = response.headers.get('Content-Type') |
| 56 | return contentType === 'application/pdf' |
| 57 | } catch (error) { |
| 58 | console.warn('Error checking PDF content type:', error) |
| 59 | return false |
| 60 | } |
| 61 | } |