Fix regex for content type check in index.js

Addresses https://github.com/actions/add-to-project/security/code-scanning/8
This commit is contained in:
Mardav Wala
2025-08-15 11:02:53 -04:00
committed by GitHub
parent 29996a4979
commit ddccd1e4c0

2
dist/index.js generated vendored
View File

@@ -5068,7 +5068,7 @@ async function getResponseData(response) {
if (/application\/json/.test(contentType)) {
return response.json().catch(() => response.text()).catch(() => "");
}
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
if (!contentType || /^(text\/|charset=utf-8)$/.test(contentType)) {
return response.text();
}
return getBufferResponse(response);