Skip to content

Commit ee5b0a6

Browse files
bingggclaude
andcommitted
fix: improve gist URL handling for raw file access
- Fix incorrect gist.githubusercontent.com URL format - Add support for full gist URLs with username (e.g., gist.github.com/user/gistId) - Update URL priority to use correct raw file access patterns - Handle both gist ID only and full URL formats 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c397063 commit ee5b0a6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/utils/claudeCodeManager.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,22 @@ class GistManager {
473473
}
474474

475475
async fetchGistRaw(gistId) {
476+
// Handle both formats: gistId only or full gist URL with username
477+
let gistPath = gistId;
478+
if (gistId.includes('gist.github.com/')) {
479+
// Extract username and gistId from full URL
480+
const match = gistId.match(/gist\.github\.com\/([^\/]+)\/([a-f0-9]+)/);
481+
if (match) {
482+
gistPath = `${match[1]}/${match[2]}`;
483+
} else {
484+
// Fallback to just gistId
485+
const idMatch = gistId.match(/([a-f0-9]+)/);
486+
gistPath = idMatch ? idMatch[1] : gistId;
487+
}
488+
}
489+
476490
const rawUrls = [
477-
`https://gist.githubusercontent.com/raw/${gistId}/claude-session.jsonl`,
491+
`https://gist.githubusercontent.com/${gistPath}/raw`,
478492
`https://gist.githubusercontent.com/raw/${gistId}`,
479493
`https://gist.github.com/${gistId}/raw/claude-session.jsonl`,
480494
`https://gist.github.com/${gistId}/raw`

0 commit comments

Comments
 (0)