forked from jsnbuchanan/crowd-funder-for-time-pwa
Fix image CORS violations with comprehensive proxy and component updates
- Applied transformImageUrlForCors to all image-displaying components - Added followRedirects: true to image proxy to serve actual content - Proxy now returns 200 OK with image data instead of 301 redirects - Maintains CORS headers required for SharedArrayBuffer support - Added debug logging for proxy response monitoring Resolves all image loading failures in development environment.
This commit is contained in:
@@ -608,7 +608,10 @@
|
||||
</div>
|
||||
<div v-if="give.fullClaim.image" class="flex justify-center">
|
||||
<a :href="give.fullClaim.image" target="_blank">
|
||||
<img :src="give.fullClaim.image" class="h-24 mt-2 rounded-xl" />
|
||||
<img
|
||||
:src="transformImageUrlForCors(give.fullClaim.image)"
|
||||
class="h-24 mt-2 rounded-xl"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
@@ -653,6 +656,7 @@ import HiddenDidDialog from "../components/HiddenDidDialog.vue";
|
||||
import { logger } from "../utils/logger";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
import { useClipboard } from "@vueuse/core";
|
||||
import { transformImageUrlForCors } from "../libs/util";
|
||||
/**
|
||||
* Project View Component
|
||||
* @author Matthew Raymer
|
||||
@@ -1552,5 +1556,12 @@ export default class ProjectViewView extends Vue {
|
||||
this.givesTotalsByUnit.find((total) => total.unit === "HUR")?.amount || 0
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms image URLs to avoid CORS issues in development
|
||||
* @param imageUrl - Original image URL
|
||||
* @returns Transformed URL for proxy or original URL
|
||||
*/
|
||||
transformImageUrlForCors = transformImageUrlForCors;
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user