mirror of
https://github.com/versia-pub/server.git
synced 2026-01-26 20:26:01 +01:00
fix(api): 🔒 Properly proxy role icons through media proxy
This commit is contained in:
parent
3d1cc52d14
commit
b17b2be683
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { proxyUrl } from "@/response";
|
||||||
import { config } from "config-manager";
|
import { config } from "config-manager";
|
||||||
import {
|
import {
|
||||||
type InferInsertModel,
|
type InferInsertModel,
|
||||||
|
|
@ -159,7 +160,7 @@ export class Role {
|
||||||
priority: this.role.priority,
|
priority: this.role.priority,
|
||||||
description: this.role.description,
|
description: this.role.description,
|
||||||
visible: this.role.visible,
|
visible: this.role.visible,
|
||||||
icon: this.role.icon,
|
icon: proxyUrl(this.role.icon),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ describe(meta.route, () => {
|
||||||
priority: 2,
|
priority: 2,
|
||||||
description: "test",
|
description: "test",
|
||||||
visible: true,
|
visible: true,
|
||||||
icon: "test",
|
icon: expect.any(String),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -191,7 +191,7 @@ describe(meta.route, () => {
|
||||||
priority: 0,
|
priority: 0,
|
||||||
description: "test2",
|
description: "test2",
|
||||||
visible: true,
|
visible: true,
|
||||||
icon: "test2",
|
icon: expect.any(String),
|
||||||
});
|
});
|
||||||
|
|
||||||
await role.save({
|
await role.save({
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ describe(meta.route, () => {
|
||||||
priority: 0,
|
priority: 0,
|
||||||
description: "test",
|
description: "test",
|
||||||
visible: true,
|
visible: true,
|
||||||
icon: "test",
|
icon: expect.any(String),
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(roles[1]).toMatchObject({
|
expect(roles[1]).toMatchObject({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue