【问题标题】:receive mail from mailgun: “The page has expired due to inactivity” - Laravel 5.5从 mailgun 接收邮件:“该页面由于不活动而过期” - Laravel 5.5
【发布时间】:2018-09-28 20:58:20
【问题描述】:

我想向我的网站发送电子邮件表单 mailgun(在带有 https 的服务器上)

所以我在 web.php 中添加:

Route::post('/text/text1', 'testController@mailgun')->name('mailgun');

在此文档中:app\Http\Middleware\VerifyCsrfToken.php

我改变了这个:

protected $except = [
  '/5087643977:AAFxaiDdfhfghyhjsqDZKBTExmDq98/webhook',
  '/test/test1/*'
];

在session.php

中
'secure' => env('SESSION_SECURE_COOKIE', true),

现在,在 mailgun 页面 (https://app.mailgun.com/app/routes) 我用这个 URL 测试它:

https://www.example.com/test/test1

但在 mailgun 测试器中,它返回 419 错误:

页面因不活动而过期。

我怎么了?

【问题讨论】:

    标签: laravel laravel-5 csrf laravel-routing


    【解决方案1】:
    protected $except = [
        '/test/test1/*'
    ];
    

    这里的模式/test/test1/*不会匹配你的请求路径/test/test1,它只会匹配/test/test1/*。您可以通过更改模式来解决此问题:

    protected $except = [
        '/test/test1'
    ];
    

    【讨论】:

      猜你喜欢
      • 2018-07-22
      • 2018-08-31
      • 2018-02-19
      • 2018-02-10
      • 2019-07-11
      • 2018-10-01
      • 1970-01-01
      • 2018-08-30
      • 1970-01-01
      相关资源
      最近更新 更多