Skip to content

Commit

Permalink
Fix issue empty user-hash in data view request headers
Browse files Browse the repository at this point in the history
to fix not compliant http request
  • Loading branch information
muhamed-abdelgaber authored Oct 25, 2024
1 parent d1eb478 commit 7fae4a3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,16 @@ export class DataViewsApiClient implements IDataViewsApiClient {
const userId = await this.getCurrentUserId();

const userHash = userId ? await sha1(userId) : '';

const headers = userHash ? { 'user-hash': userHash } : {};

const request = body
? this.http.post<T>(url, { query, body, version, asResponse })
: this.http.fetch<T>(url, {
query,
version,
...cacheOptions,
asResponse,
headers: { 'user-hash': userHash },
headers,
});

return request.catch((resp) => {
Expand Down

0 comments on commit 7fae4a3

Please sign in to comment.