Giter Site home page Giter Site logo

不支持OPTIONS请求 about swoft HOT 7 CLOSED

swoft-cloud avatar swoft-cloud commented on May 1, 2024
不支持OPTIONS请求

from swoft.

Comments (7)

daydaygo avatar daydaygo commented on May 1, 2024

能提供稳定复现的例子的么? 欢迎通过 交流群 / 邮件组 进行沟通

from swoft.

stelin avatar stelin commented on May 1, 2024

@QiiSyhx 提供下使用demo,方便我们定位问题。

from swoft.

xiongxin avatar xiongxin commented on May 1, 2024

@stelin @daydaygo 他应该说的是

/**
 * 请求方法
 *
 * @uses      RequestMethod
 * @version   2017年08月22日
 * @author    stelin <[email protected]>
 * @copyright Copyright 2010-2016 Swoft software
 * @license   PHP Version 7.x {@link http://www.php.net/license/3_0.txt}
 */
class RequestMethod
{
    /**
     * get方法
     */
    const GET = 'get';

    /**
     * post方法
     */
    const POST = 'post';

    /**
     * put方法
     */
    const PUT = 'put';

    /**
     * delete方法
     */
    const DELETE = 'delete';

    /**
     * patch方法
     */
    const PATCH = 'patch';
}

现在没有支持的option方法

from swoft.

inhere avatar inhere commented on May 1, 2024

内部是支持的 只是这里忘了写常量
你直接写字符串 options 也是可以的

from swoft.

stelin avatar stelin commented on May 1, 2024

@inhere 要不两边用同一份定义

from swoft.

huangzhhui avatar huangzhhui commented on May 1, 2024

这个理应通过一个 Middleware 来解决,不然的话每个暴露出去的接口都要写一遍 OPTIONS 方法支持,而且 Action 直接支持 OPTIONS 也没法达到 CORS 本身对请求的要求

from swoft.

xiongxin avatar xiongxin commented on May 1, 2024

@huangzhhui 对的,中间件好点

from swoft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.