fastify-txstate 3.2.11 → 3.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +3 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -28,7 +28,6 @@ const node_fs_1 = __importDefault(require("node:fs"));
28
28
  const node_http_1 = __importDefault(require("node:http"));
29
29
  const txstate_utils_1 = require("txstate-utils");
30
30
  const error_1 = require("./error");
31
- const unified_auth_1 = require("./unified-auth");
32
31
  exports.devLogger = {
33
32
  level: 'info',
34
33
  info: (msg) => { console.info(msg.req ? `${msg.req.method} ${msg.req.url}` : msg.res ? `${msg.res.statusCode} - ${msg.responseTime}` : msg); },
@@ -169,6 +168,8 @@ class Server {
169
168
  else {
170
169
  void res.header('Access-Control-Allow-Origin', req.headers.origin);
171
170
  void res.header('Access-Control-Max-Age', '600'); // ask browser to skip pre-flights for 10 minutes after a yes
171
+ if (req.headers['access-control-request-method'])
172
+ void res.header('access-control-allow-methods', req.headers['access-control-request-method']);
172
173
  if (req.headers['access-control-request-headers'])
173
174
  void res.header('Access-Control-Allow-Headers', req.headers['access-control-request-headers']);
174
175
  }
@@ -326,7 +327,7 @@ class Server {
326
327
  }
327
328
  async swagger(opts) {
328
329
  let openapi = opts?.openapi ?? {};
329
- if (this.config.authenticate === unified_auth_1.unifiedAuthenticate) {
330
+ if (this.config.authenticate != null) {
330
331
  openapi = (0, txstate_utils_1.set)(openapi, 'components.securitySchemes', {
331
332
  unifiedAuth: {
332
333
  type: 'http',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastify-txstate",
3
- "version": "3.2.11",
3
+ "version": "3.2.12",
4
4
  "description": "A small wrapper for fastify providing a set of common conventions & utility functions we use.",
5
5
  "exports": {
6
6
  ".": {