Chrome Private Network preflights

Hey all-

I’m just looking into this more. First, I am running Chrome Version 106.0.5249.61 and was running some 101 variant until recently. I have not encountered any issues with our FA development environment.

That said, I was going through the suggested steps and I noticed that the instructions specify to add

app.use(function (req, res, next) {
  if (req.headers["access-control-request-private-network"]) {
    res.setHeader("access-control-allow-private-network", "true");
  }
  next(null);
});

before

app.use(morgan("tiny"));

My question is this: we use morgan but not morgan("tiny")

app.use(
  morgan(
    ":id :remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms",
    { stream: logger.stream }
  )
);

is it still advised to add the suggested code before the use of morgan?

  • Project name: scratchpay-payment-service
  • Team name: all
  • Environment name: Development
  • Agent type & version: …
  • Recent changes made on your end if any: none

Hi @Brett_Belka !
I don’t think putting it before or after the app.use(morgan("tiny")); would change anything

Thanks for the feedback. My point was more that we don’t use morgan("tiny") at all… We use morgan but not "tiny".

Put another way - is the suggested change supposed to be required for any use of morgan or only morgan("tiny")?

It is not related to morgan, we used morgan as an exemple so that people know that they need to put it early in their code.

1 Like