generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the gateway-service tests for removing duplicated code
- Loading branch information
1 parent
18636fe
commit ab9b42c
Showing
2 changed files
with
39 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,9 +60,9 @@ app.get('/questions', async (req, res) => { | |
|
||
app.get('/questions/:lang/:amount/:type', async (req, res) => { | ||
try { | ||
const lang = req.params.lang; | ||
const amount = req.params.amount; | ||
const type = req.params.type; | ||
const lang = req.params.lang.toString(); | ||
const amount = req.params.amount.toString(); | ||
const type = req.params.type.toString(); | ||
// Forward the question request to the quetion service | ||
const questionResponse = await axios.get(questionServiceUrl+'/questions/' + lang + '/' + amount + '/' + type); | ||
Check warning Code scanning / SonarCloud Server-side requests should not be vulnerable to forging attacks Medium
Change this code to not construct the URL from user-controlled data. See more on SonarCloud
|
||
|
||
|
@@ -76,8 +76,8 @@ app.get('/questions/:lang/:amount/:type', async (req, res) => { | |
|
||
app.get('/questions/:lang/:amount', async (req, res) => { | ||
try { | ||
const lang = req.params.lang; | ||
const amount = req.params.amount; | ||
const lang = req.params.lang.toString(); | ||
const amount = req.params.amount.toString(); | ||
// Forward the question request to the quetion service | ||
const questionResponse = await axios.get(questionServiceUrl+'/questions/' + lang + '/' + amount); | ||
Check warning Code scanning / SonarCloud Server-side requests should not be vulnerable to forging attacks Medium
Change this code to not construct the URL from user-controlled data. See more on SonarCloud
|
||
|
||
|
@@ -90,7 +90,7 @@ app.get('/questions/:lang/:amount', async (req, res) => { | |
|
||
app.get('/questions/:lang', async (req, res) => { | ||
try { | ||
const lang = req.params.lang; | ||
const lang = req.params.lang.toString(); | ||
// Forward the question request to the quetion service | ||
const questionResponse = await axios.get(questionServiceUrl+'/questions/' + lang); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters