Skip to content

Fixed: #7274#7278

Closed
deypartha wants to merge 1 commit into
expressjs:masterfrom
deypartha:master
Closed

Fixed: #7274#7278
deypartha wants to merge 1 commit into
expressjs:masterfrom
deypartha:master

Conversation

@deypartha
Copy link
Copy Markdown

Fix: #7274

Copilot AI review requested due to automatic review settings May 23, 2026 19:42
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedisbot@​3.8.010010010092100

View full report

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds bot-aware OG meta injection to the examples/search app by introducing a streaming HTML head injector and using isbot to detect crawlers.

Changes:

  • Add isbot dependency to support bot detection in example route(s)
  • Introduce InjectMetaTransform stream to inject HTML into <head> without loading the whole file
  • Enhance examples/search to run without Redis installed (in-memory fallback) and add a bot-aware /video/:id route

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
package.json Adds isbot dependency used by the new bot-aware example route
lib/injectMetaTransform.js New Transform stream to inject meta HTML before </head>
examples/search/index.js Redis optional fallback, formatting updates, and new bot-aware /video/:id route using the injector

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/search/index.js

app.get('/search/{:query}', function (req, res, next) {
var query = req.params.query || '';
app.get("/search/{:query}", function (req, res, next) {
Comment thread package.json
"router": "^2.2.0",
"send": "^1.1.0",
"serve-static": "^2.2.0",
"isbot": "^3.6.0",
Comment on lines +19 to +21
this.buffer += chunk.toString("utf8");

const idx = this.buffer.indexOf("</head>");
Comment on lines +31 to +35
// keep buffer bounded to avoid OOM on malformed HTML
if (this.buffer.length > 128 * 1024) {
this.push(this.buffer);
this.buffer = "";
}
Comment thread examples/search/index.js
Comment on lines +120 to +123
res.type("html");
const stream = fs.createReadStream(indexPath);
stream.on("error", next);
stream.pipe(new InjectMetaTransform(metaHtml)).pipe(res);
@krzysdz
Copy link
Copy Markdown
Contributor

krzysdz commented May 24, 2026

If you have some suggestions or answers to other people's questions, then please either post the code in response or create a separate gist/repo showing your idea. Modifying an existing example to do something completely different from what it is supposed to do makes things harder to understand.

@krzysdz krzysdz closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to inject Open Graph/Meta tags for Social Media before the sendFile function?

3 participants