Skip to content

Fix three code bugs#1

Draft
hdushan wants to merge 1 commit intomainfrom
cursor/fix-three-code-bugs-1215
Draft

Fix three code bugs#1
hdushan wants to merge 1 commit intomainfrom
cursor/fix-three-code-bugs-1215

Conversation

@hdushan
Copy link
Owner

@hdushan hdushan commented Aug 19, 2025

Fixes insecure HTTP, unencoded URL parameters, and OpenAI client initialization issues.

This PR addresses three bugs:

  • Insecure HTTP request: Switched http://httpbun.org/post to https://httpbun.org/post in src/restOperations.js and updated mock tests.
  • Unencoded user input: Applied encodeURIComponent to the name parameter in src/restOperations.js's gender function to prevent issues with special characters.
  • OpenAI client: Converted src/openAi.js to ESM, added OPENAI_API_KEY validation, and implemented a singleton client instance for efficiency, updating src/openAi.test.js to reflect these changes.

Open in Cursor Open in Web

Co-authored-by: hansrd_98 <hansrd_98@yahoo.com>
@cursor
Copy link

cursor bot commented Aug 19, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants