Merge pull request #38365 from JanisPlayer/patch-3

add imaginary_key
This commit is contained in:
Louis 2023-05-22 23:39:26 +02:00 committed by GitHub
commit c8e85a4ecf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -1227,6 +1227,11 @@ $CONFIG = [
*/
'preview_imaginary_url' => 'http://previews_hpb:8088/',
/**
* If you want set a api key for imaginary.
*/
'preview_imaginary_key' => 'secret',
/**
* Only register providers that have been explicitly enabled
*

View file

@ -136,9 +136,10 @@ class Imaginary extends ProviderV2 {
];
try {
$imaginaryKey = $this->config->getSystemValueString('preview_imaginary_key', '');
$response = $httpClient->post(
$imaginaryUrl . '/pipeline', [
'query' => ['operations' => json_encode($operations)],
'query' => ['operations' => json_encode($operations), 'key' => $imaginaryKey],
'stream' => true,
'content-type' => $file->getMimeType(),
'body' => $stream,