Skip to content

Commit

Permalink
Fix code scanning alert no. 18: Full server-side request forgery
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 98b4f8e commit ddc261a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
import tiktoken

def make_prompt_request(prompt, max_tokens = 2048, timeout = 4):
#url = "https://api.openai.com/v1/embeddings"
# Whitelist of allowed URLs
allowed_urls = ["https://api.openai.com/v1/embeddings", "https://another-trusted-url.com"]
url = os.getenv("AOAI_ENDPOINT")
if url not in allowed_urls:
raise ValueError("The provided URL is not allowed.")
key = os.getenv("AOAI_KEY")

payload_dict = {"prompt": prompt,
Expand Down

0 comments on commit ddc261a

Please sign in to comment.