diff --git a/samples/web/README.md b/samples/web/README.md index a0f64c3..a46f3e2 100644 --- a/samples/web/README.md +++ b/samples/web/README.md @@ -92,17 +92,6 @@ For rapid testing, you can initiate a liveness session by adding the ``` -#### Hosting environment updates - -This SDK uses WebAssembly, SharedArrayBuffer, and MediaDevices.getUserMedia() features from Web API. To host your web app, your hosting environment must support secure context. In particular, the response headers must include the following as baseline requirement: - - - `Content-Type` must be set properly according to the MIME type. - - For top-level documents: - - `Cross-Origin-Opener-Policy` must be set to `same-origin` . - - `Cross-Origin-Embedder-Policy` must be set to `require-corp` (more widely supported) or `credentialless` (less widely supported). - - For nested documents and subresources: - - `Cross-Origin-Resource-Policy` must not be empty and must be set appropriately. - #### Deployment It's important to note that essential assets like WebAssembly (wasm) files and worker JavaScript files are packaged within the NPM distribution. During deployment to a production environment, it's essential to include these assets. As an example, you can deploy the 'faceanalyzer-assets' from the node_modules\azure-ai-vision-faceanalyzer folder to the root assets directory after the npm installation to ensure proper asset deployment. diff --git a/samples/web/angularjs/.gitignore b/samples/web/angularjs/.gitignore index 286ff37..19e164d 100644 --- a/samples/web/angularjs/.gitignore +++ b/samples/web/angularjs/.gitignore @@ -42,6 +42,7 @@ yarn-error.log /libpeerconnection.log testem.log /typings +public/faceanalyzer-assets # System files .DS_Store diff --git a/samples/web/angularjs/angular.json b/samples/web/angularjs/angular.json index 42c347e..37a1412 100644 --- a/samples/web/angularjs/angular.json +++ b/samples/web/angularjs/angular.json @@ -73,14 +73,7 @@ "buildTarget": "face-angular-js:build:development" } }, - "defaultConfiguration": "development", - "options": { - "headers": { - "X-Frame-Options": "SAMEORIGIN", - "Cross-Origin-Opener-Policy": "same-origin", - "Cross-Origin-Embedder-Policy": "require-corp" - } - } + "defaultConfiguration": "development" }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n" diff --git a/samples/web/angularjs/server.js b/samples/web/angularjs/server.js index 6f0d5c5..dd285ac 100644 --- a/samples/web/angularjs/server.js +++ b/samples/web/angularjs/server.js @@ -14,13 +14,6 @@ app.use(express.json()); const storage = multer.memoryStorage(); const upload = multer({ storage: storage }); -// **IMPORTANT**: This middleware sets headers for all responses, static or not. -app.all("*", function (req, res, next) { - res.setHeader("Cross-Origin-Embedder-Policy", "require-corp"); - res.setHeader("Cross-Origin-Opener-Policy", "same-origin"); - next(); -}); - app.get("/", (_req, res) => { res.sendFile(`${__dirname}/dist/face-angular-js/browser/index.html`); }); diff --git a/samples/web/nextjs/.gitignore b/samples/web/nextjs/.gitignore index c9b6000..904d4ff 100644 --- a/samples/web/nextjs/.gitignore +++ b/samples/web/nextjs/.gitignore @@ -19,6 +19,7 @@ # production /build +public/faceanalyzer-assets # misc .DS_Store diff --git a/samples/web/nextjs/components/FaceAnalyzerSampleClient.tsx b/samples/web/nextjs/components/FaceAnalyzerSampleClient.tsx index ec00965..50ded3d 100644 --- a/samples/web/nextjs/components/FaceAnalyzerSampleClient.tsx +++ b/samples/web/nextjs/components/FaceAnalyzerSampleClient.tsx @@ -4,9 +4,6 @@ import Image from "next/image"; import { ChangeEvent, useState } from "react"; import dynamic from "next/dynamic"; -// Only import type because "azure-ai-vision-faceanalyzer" is already initialized in face_analyzer/face.tsx -import type { FaceAnalyzedResult } from "azure-ai-vision-faceanalyzer"; - // Result View static assets const checkmarkCircleIcon = "CheckmarkCircle.png"; const heartPulseIcon = "HeartPulse.png"; diff --git a/samples/web/nextjs/middleware.js b/samples/web/nextjs/middleware.js deleted file mode 100644 index df24be6..0000000 --- a/samples/web/nextjs/middleware.js +++ /dev/null @@ -1,9 +0,0 @@ -// app/middleware.js -import { NextResponse } from 'next/server'; - -export function middleware(request) { - const response = NextResponse.next(); - response.headers.set('Cross-Origin-Opener-Policy', 'same-origin'); - response.headers.set('Cross-Origin-Embedder-Policy', 'require-corp'); - return response; -} diff --git a/samples/web/vuejs/.gitignore b/samples/web/vuejs/.gitignore index 51e0d6e..c6a481a 100644 --- a/samples/web/vuejs/.gitignore +++ b/samples/web/vuejs/.gitignore @@ -1,7 +1,7 @@ .DS_Store node_modules /dist - +public/faceanalyzer-assets # local env files .env.local diff --git a/samples/web/vuejs/server.js b/samples/web/vuejs/server.js index 18221f8..ae3e2df 100644 --- a/samples/web/vuejs/server.js +++ b/samples/web/vuejs/server.js @@ -14,13 +14,6 @@ app.use(express.json()); const storage = multer.memoryStorage(); const upload = multer({ storage: storage }); -// **IMPORTANT**: This middleware sets headers for all responses, static or not. -app.all("*", function (req, res, next) { - res.setHeader("Cross-Origin-Embedder-Policy", "require-corp"); - res.setHeader("Cross-Origin-Opener-Policy", "same-origin"); - next(); -}); - app.get("/", (_req, res) => { res.sendFile(`${__dirname}/dist/index.html`); });