feat(uuid): implement UUID generation for non-secure contexts and replace crypto.randomUUID() usage

This commit is contained in:
PeymanHonarjoo
2026-10-12 16:50:52 +03:30
parent e268631386
commit 0af55f52a3
7 changed files with 64 additions and 15 deletions
@@ -1,6 +1,7 @@
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { Injectable, inject } from '@angular/core';
import { firstValueFrom, Observable } from 'rxjs';
import { uuid } from '../../shared/utils/uuid';
import { VOICE_STREAM_CONFIG, VoiceSessionStatus } from './voice-stream.types';
/**
@@ -165,7 +166,7 @@ export class VoiceApiService {
}
private readOptions() {
return { withCredentials: true, headers: new HttpHeaders({ 'X-Request-ID': crypto.randomUUID() }) };
return { withCredentials: true, headers: new HttpHeaders({ 'X-Request-ID': uuid() }) };
}
private writeOptions(csrf: string) {
@@ -173,7 +174,7 @@ export class VoiceApiService {
withCredentials: true,
headers: new HttpHeaders({
'X-CSRF-Token': csrf,
'X-Request-ID': crypto.randomUUID(),
'X-Request-ID': uuid(),
}),
};
}