Skip to content

Commit

Permalink
Refine customization of @azure-rest/ai-vision-face to not set filenam…
Browse files Browse the repository at this point in the history
…e for MFD when there has already been one
  • Loading branch information
Chung Sheng Fu authored and Chung Sheng Fu committed May 22, 2024
1 parent 2189b83 commit d688279
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdk/face/ai-vision-face-rest/src/faceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export default function createClient(
name: "VerifyImageFilenamePolicy",
sendRequest: (request, next) => {
for (const part of request.multipartBody?.parts ?? []) {
if (part.headers.get("content-disposition")?.includes(`name="VerifyImage"`)) {
const contentDisposition = part.headers.get("content-disposition");
if (
contentDisposition &&
contentDisposition.includes(`name="VerifyImage"`) &&
!contentDisposition.includes("filename=")
) {
part.headers.set("content-disposition", `form-data; name="VerifyImage"; filename="blob"`);
}
}
Expand Down

0 comments on commit d688279

Please sign in to comment.