@adonisjs/http-server 7.0.0-3 → 7.0.0

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.
@@ -9,7 +9,7 @@ import is from "@sindresorhus/is";
9
9
  import Macroable4 from "@poppinss/macroable";
10
10
  import Middleware from "@poppinss/middleware";
11
11
  import { RuntimeException as RuntimeException2 } from "@poppinss/utils";
12
- import { moduleCaller, moduleExpression, moduleImporter } from "@adonisjs/fold";
12
+ import { moduleCaller, moduleImporter } from "@adonisjs/fold";
13
13
 
14
14
  // src/router/factories/use_return_value.ts
15
15
  function useReturnValue(ctx) {
@@ -673,9 +673,13 @@ var Route = class extends Macroable4 {
673
673
  */
674
674
  #resolveRouteHandle(handler) {
675
675
  if (typeof handler === "string") {
676
+ const parts = handler.split(".");
677
+ const method = parts.length === 1 ? "handle" : parts.pop();
678
+ const moduleRefId = parts.join(".");
676
679
  return {
677
680
  reference: handler,
678
- ...moduleExpression(handler, this.#app.appRoot).toHandleMethod()
681
+ ...moduleImporter(() => this.#app.import(moduleRefId), method).toHandleMethod(),
682
+ name: handler
679
683
  };
680
684
  }
681
685
  if (Array.isArray(handler)) {
@@ -4340,7 +4344,7 @@ var Server = class {
4340
4344
  * Handle request
4341
4345
  */
4342
4346
  handle(req, res) {
4343
- const hasRequestListener = this.#emitter.hasListeners("http:request_finished");
4347
+ const hasRequestListener = this.#emitter.hasListeners("http:request_completed");
4344
4348
  const startTime = hasRequestListener ? process.hrtime() : null;
4345
4349
  const resolver = this.#app.container.createResolver();
4346
4350
  const ctx = this.createHttpContext(
@@ -4350,7 +4354,7 @@ var Server = class {
4350
4354
  );
4351
4355
  if (startTime) {
4352
4356
  onFinished2(res, () => {
4353
- this.#emitter.emit("http:request_finished", {
4357
+ this.#emitter.emit("http:request_completed", {
4354
4358
  ctx,
4355
4359
  duration: process.hrtime(startTime)
4356
4360
  });
@@ -4380,8 +4384,8 @@ function defineConfig(config) {
4380
4384
  maxAge: "2h",
4381
4385
  path: "/",
4382
4386
  httpOnly: true,
4383
- secure: false,
4384
- sameSite: false
4387
+ secure: true,
4388
+ sameSite: "lax"
4385
4389
  },
4386
4390
  qs: {
4387
4391
  parse: {
@@ -4434,4 +4438,4 @@ export {
4434
4438
  Server,
4435
4439
  defineConfig
4436
4440
  };
4437
- //# sourceMappingURL=chunk-NC6OWANS.js.map
4441
+ //# sourceMappingURL=chunk-OZEDU2EZ.js.map