mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
update thumbnail if failed to fetch and return url if already signed
This commit is contained in:
parent
f06d2558c2
commit
7bd747601b
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { encode } from 'urlsafe-base64'
|
||||
import crypto from 'crypto'
|
||||
import { encode } from 'urlsafe-base64'
|
||||
import { env } from '../env'
|
||||
|
||||
function signImageProxyUrl(url: string): string {
|
||||
|
|
@ -17,6 +17,11 @@ export function createImageProxyUrl(
|
|||
return url
|
||||
}
|
||||
|
||||
// url is already signed
|
||||
if (url.startsWith(env.imageProxy.url)) {
|
||||
return url
|
||||
}
|
||||
|
||||
const urlWithOptions = `${url}#${width}x${height}`
|
||||
const signature = signImageProxyUrl(urlWithOptions)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue