feat(desktop-client): fall back to authenticated desktop asset endpoint
When a public asset URL fails (e.g. stale signed token), retry via the new /api/desktop/content/assets endpoint with the desktop Bearer token so editor images keep rendering across token rotations. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ vi.mock("electron", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("../transport/api-client", () => ({
|
||||
fetchDesktopApiURL: vi.fn(),
|
||||
resolveDesktopApiURL: (path: string) => `http://127.0.0.1:8080${path}`,
|
||||
}));
|
||||
|
||||
@@ -27,10 +28,12 @@ import {
|
||||
} from "./media-image";
|
||||
|
||||
describe("media image helpers", () => {
|
||||
it("resolves API asset URLs through the desktop API base and requests png output", () => {
|
||||
expect(buildAssetURLCandidates("/api/public/assets/12").at(0)).toBe(
|
||||
it("resolves public asset URLs through public and authenticated desktop candidates", () => {
|
||||
expect(buildAssetURLCandidates("/api/public/assets/12")).toEqual([
|
||||
"http://127.0.0.1:8080/api/public/assets/12?format=png",
|
||||
);
|
||||
"http://127.0.0.1:8080/api/desktop/content/assets/12?format=png",
|
||||
"http://127.0.0.1:8080/api/public/assets/12",
|
||||
]);
|
||||
});
|
||||
|
||||
it("centers crop rectangles at the requested ratio", () => {
|
||||
|
||||
Reference in New Issue
Block a user