Coder Social home page Coder Social logo

Comments (3)

arcfide avatar arcfide commented on July 29, 2024

Looking into the code, it appears that Jarvis doesn't actually support any CORS handling for a JSON service, meaning that the service is inaccessible for a wide range of applications. I think it would be good to have CORS handling built-in.

from jarvis.

arcfide avatar arcfide commented on July 29, 2024

The current code in HandleRequest might be able to be retrofitted to rely on the application provided Validate function to handle the request. The only issue is that there is no way to signal to the system that the Validate has in fact Validated and completed the response. It's only a pass/fail.

We could split into a pass / response / fail mode, or we could leave the Validate function as a pass/fail and then have another function that handles CORS.

At the moment I'm inclined to just use the pass / response / fail model. I suggest that the return code will indicate this. If it is 0, then it is a passthrough. If it's positive, it's a fail and should follow the normal fail path. If it's a -1, then it should immediately send the response that was crafted by the validate function.

from jarvis.

arcfide avatar arcfide commented on July 29, 2024

c294037 adds support for CORS by default for JSON servers now.

from jarvis.

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.