Skip to content

Commit

Permalink
Fixed an issue where different cache keys could be generated with the…
Browse files Browse the repository at this point in the history
… same input resulting in different responses.

* Fixed an issue where different cache key is generated for the same message content

* Feedback fixed
  • Loading branch information
barthc authored Apr 18, 2024
1 parent da1debc commit 01ba1c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion class-gwiz-gf-openai.php
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ public function make_request( $endpoint, $body, $feed ) {

$cache_key = sha1( serialize( array(
'url' => $url,
'body' => $body,
'body' => map_deep( $body, 'sanitize_text_field' ), // Sanitize the `$body` variable to ensure consistent `$cache_key`
'request_params' => $this->get_request_params( $feed ),
) ) );

Expand Down

0 comments on commit 01ba1c2

Please sign in to comment.