Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In PR #22154 in an attempt to fix some CodeQL warnings we broke the local execution of xharness. The reason is the following, CodeQL complained about sanitizing the local path and in an attempt to remove the warning a test to make sure that the local path does not have a '/' was added. The issue is that our requests, when we run xharness locally, will return localpaths of the form: '/20250221_181807/index.html' that is because the request is for 'http://localhost:51234/20250221_181807/index.html'. In webapps, the path of the request ALWAYS starts with '/' even when the request is for 'http://localhost:51234' (which returns '/'). In an attemp to fix xharness AND keep CodeQL happy I have made the following changes: 1. Ensure that the full path is one of the allowed ones. 2. If the path is not one of the allowed ones, check if it is and allowed file. 2. Do not try to check for '/' or '\' but verify that the path instead get the path directory and ensure that is the one for the logs and no other. This should fix xharness and keep CodeQL happy.
- Loading branch information