Skip to content

Commit 7d131c5

Browse files
etairlclaude
andcommitted
fix(ai): drop explanatory comment in getMediaTypeFromUrl
Per review on vercel#14751: the regression test for the prototype-property collision case is enough; the inline comment is redundant. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 9f0d803 commit 7d131c5

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

packages/ai/src/prompt/convert-to-language-model-prompt.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -742,9 +742,6 @@ function getMediaTypeFromUrl(
742742
try {
743743
const pathname = new URL(url).pathname;
744744
const ext = pathname.split('.').pop()?.toLowerCase();
745-
// Use `Object.hasOwn` instead of `in` so attacker-controlled extensions
746-
// like `constructor` cannot resolve to inherited `Object.prototype`
747-
// members and leak a non-string value through this `: string` helper.
748745
if (ext && Object.hasOwn(URL_EXTENSION_TO_MEDIA_TYPE, ext)) {
749746
return URL_EXTENSION_TO_MEDIA_TYPE[ext];
750747
}

0 commit comments

Comments
 (0)