mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-07-12 09:45:44 +08:00
Fix issue: Broken pasted image upload
This commit is contained in:
@@ -447,7 +447,7 @@ app.post('/api/projects/create', authenticateToken, async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Browse filesystem endpoint for project suggestions - uses existing getFileTree
|
// Browse filesystem endpoint for project suggestions - uses existing getFileTree
|
||||||
app.get('/api/browse-filesystem', authenticateToken, async (req, res) => {
|
app.get('/api/browse-filesystem', authenticateToken, async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { path: dirPath } = req.query;
|
const { path: dirPath } = req.query;
|
||||||
|
|
||||||
@@ -495,9 +495,9 @@ app.get('/api/browse-filesystem', authenticateToken, async (req, res) => {
|
|||||||
suggestions.push(...directories);
|
suggestions.push(...directories);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
path: targetPath,
|
path: targetPath,
|
||||||
suggestions: suggestions
|
suggestions: suggestions
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -3,9 +3,12 @@ export const authenticatedFetch = (url, options = {}) => {
|
|||||||
const isPlatform = import.meta.env.VITE_IS_PLATFORM === 'true';
|
const isPlatform = import.meta.env.VITE_IS_PLATFORM === 'true';
|
||||||
const token = localStorage.getItem('auth-token');
|
const token = localStorage.getItem('auth-token');
|
||||||
|
|
||||||
const defaultHeaders = {
|
const defaultHeaders = {};
|
||||||
'Content-Type': 'application/json',
|
|
||||||
};
|
// Only set Content-Type if body is not FormData (browser will set it automatically for FormData)
|
||||||
|
if (!(options.body instanceof FormData)) {
|
||||||
|
defaultHeaders['Content-Type'] = 'application/json';
|
||||||
|
}
|
||||||
|
|
||||||
if (!isPlatform && token) {
|
if (!isPlatform && token) {
|
||||||
defaultHeaders['Authorization'] = `Bearer ${token}`;
|
defaultHeaders['Authorization'] = `Bearer ${token}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user