Skip to content

Commit 9cacabc

Browse files
committed
Only show CDN info notes when relevant headers are present
- Fastly note (explaining X-Cache layers) only shows when x-cache header exists - CloudFront note (explaining Origin Shield) only shows on MISS status Previously, the Fastly note appeared for all Fastly-detected sites even when they didn't have an x-cache header, which was confusing.
1 parent 81f37e4 commit 9cacabc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • CF Cache Status/CF Cache Status Extension/Resources

CF Cache Status/CF Cache Status Extension/Resources/popup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ function updateUI(data) {
157157
document.getElementById('url-container').classList.remove('hidden');
158158
}
159159

160-
// Show CDN-specific info notes
161-
if (data?.cdn === 'cloudfront') {
160+
// Show CDN-specific info notes (only when relevant headers are present)
161+
if (data?.cdn === 'cloudfront' && data.status === 'MISS') {
162162
document.getElementById('cloudfront-info').classList.remove('hidden');
163-
} else if (data?.cdn === 'fastly') {
163+
} else if (data?.cdn === 'fastly' && data.headers?.['x-cache']) {
164164
document.getElementById('fastly-info').classList.remove('hidden');
165165
}
166166
}

0 commit comments

Comments
 (0)