diff --git a/backend/src/main/java/ch/xxx/aidoclibchat/adapter/config/SecurityConfig.java b/backend/src/main/java/ch/xxx/aidoclibchat/adapter/config/SecurityConfig.java index 0d9bce6..09f4a41 100644 --- a/backend/src/main/java/ch/xxx/aidoclibchat/adapter/config/SecurityConfig.java +++ b/backend/src/main/java/ch/xxx/aidoclibchat/adapter/config/SecurityConfig.java @@ -49,7 +49,7 @@ public SecurityFilterChain configure(HttpSecurity http) throws Exception { .sessionManagement(mySm -> mySm.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .headers(myHeaders -> myHeaders.xssProtection(myXss -> myXss.headerValue(HeaderValue.ENABLED))) .headers(myHeaders -> myHeaders.contentSecurityPolicy(myCsp -> myCsp.policyDirectives( - "default-src 'self' data:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';"))) + "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';"))) .headers(myHeaders -> myHeaders.frameOptions(myFo -> myFo.sameOrigin())) // .addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class) ; diff --git a/frontend/src/angular/src/app/image-query/image-query.component.html b/frontend/src/angular/src/app/image-query/image-query.component.html index 7d299ba..10588cc 100644 --- a/frontend/src/angular/src/app/image-query/image-query.component.html +++ b/frontend/src/angular/src/app/image-query/image-query.component.html @@ -30,7 +30,7 @@
} @else if(result) {
-
+
{{result.answer}}
} @else { diff --git a/frontend/src/angular/src/app/image-query/image-query.component.ts b/frontend/src/angular/src/app/image-query/image-query.component.ts index ff1c9a1..d9a0ed2 100644 --- a/frontend/src/angular/src/app/image-query/image-query.component.ts +++ b/frontend/src/angular/src/app/image-query/image-query.component.ts @@ -48,8 +48,11 @@ export class ImageQueryComponent { this.imageForm.controls.file.setValue(!!files && files.length > 0 ? files[0] : null); } - protected createImageUrl(): string { - return !this.result ? '' : 'data:image/'+this?.result?.imageType+';base64,'+this?.result?.b64Image; + protected createImageUrl(myResult: ImageFile): ImageFile { + if(!!myResult) { + myResult.b64Image = 'data:image/'+myResult?.imageType+';base64,'+myResult?.b64Image; + } + return myResult } protected upload(): void { @@ -75,7 +78,7 @@ export class ImageQueryComponent { ) .subscribe((result) => { this.uploading = false; - this.result = result; + this.result = this.createImageUrl(result); this.imageForm.controls.file.setValue(null); //console.log(result); });