Giter Site home page Giter Site logo

Comments (3)

essen avatar essen commented on May 27, 2024

You can't because constraints are applied to bindings and '_' doesn't bind anything.

The best approach for your case is probably to write a middleware that you put between cowboy_router and cowboy_handler that would check if it's a PHP file and change the handler and handler_opts value based on that, or simply stop the request there and return a 4xx error.

from cowboy.

richard-giraud avatar richard-giraud commented on May 27, 2024

@essen Thank you for response I appreciate you clarifying what is possible at this time and I will investigate the approach you recommended.

Is the omission of this feature a design choice? Or is it desirable and simply not implemented yet?

If this is a feature that is not wanted, I think there is value in updating the documentation to explicitly mention that using constraints with […] is not possible. It may save the next person some of the hours that I spent trying to figure it out.

I’m happy to help with this as best as I can. Please let me know if either of the above appeals to you and I will do my best to craft a suitable PR.

Thanks again

from cowboy.

essen avatar essen commented on May 27, 2024

Documentation updates are always welcome, regardless of why things are as they are.

In this case, the code is a few years old so I'm not sure why it's only applying to explicitly bound values. I likely have not thought about using them with '_' or '...' yet. Experimenting with this would be welcome but note that I don't know what it should look like at this point.

from cowboy.

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.