Skip to content

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Sep 12, 2025

No description provided.

@asgerf asgerf added the no-change-note-required This PR does not need a change note label Sep 12, 2025
@github-actions github-actions bot added the JS label Sep 12, 2025
@asgerf asgerf marked this pull request as ready for review September 16, 2025 10:56
@asgerf asgerf requested a review from a team as a code owner September 16, 2025 10:56
@Copilot Copilot AI review requested due to automatic review settings September 16, 2025 10:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds modeling for Express.js response methods json() and jsonp() to the CodeQL JavaScript library. These methods are commonly used to send JSON responses and set appropriate content-type headers.

  • Adds new classes to model res.json() and res.jsonp() calls as header definitions and response send arguments
  • Creates test cases to verify the modeling works correctly with Express routes
  • Updates expected test results to include the new JSON response handling

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
javascript/ql/lib/semmle/javascript/frameworks/Express.qll Adds ResponseJsonCall and ResponseJsonCallArgument classes to model Express json/jsonp methods
javascript/ql/test/library-tests/frameworks/Express/src/json.js New test file with routes using res.json() and res.jsonp()
javascript/ql/test/library-tests/frameworks/Express/tests.expected Updated expected test results to include the new JSON response modeling

Napalys
Napalys previously approved these changes Sep 16, 2025
Copy link
Contributor

@Napalys Napalys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍 I think Copilot's suggestion is correct regarding the docstring and we should change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants