Code Monkey home page Code Monkey logo

Comments (6)

jorgemsrs avatar jorgemsrs commented on August 20, 2024

Using the baseline service

 curl -X GET http://0:8080/cougarBaseline/v2/propertyEcho?propertyName=cougar.client.http.uuidparentsheader

works as expected. When one runs

curl -X OPTIONS http://0:8080/cougarBaseline/v2/propertyEcho?propertyName=cougar.client.http.uuidparentsheader

the behaviour is somewhat unexpected for me because it succeeds as well. The extensions clearly defines GET as the verb to use (file BaselineService-extensions line 33) and this is where i find it confusing.

I'm thinking of a possible impl for cors to submit for your judgment and it would be following the lines of com.betfair.cougar.transport.jetty.GzipHandler. The issue with it is that it would hijack the OPTIONS verb for cors handling and would break the behaviour described above...

from cougar.

eswdd avatar eswdd commented on August 20, 2024

What is the behaviour with OPTIONS?

If currently it behaves same as GET then this is a bug so we should be
comfortable breaking it.
On 10 Nov 2014 10:53, "Jorge Silva" [email protected] wrote:

Using the baseline service

curl -X GET http://0:8080/cougarBaseline/v2/propertyEcho?propertyName=cougar.client.http.uuidparentsheader

works as expected. When one runs

curl -X OPTIONS http://0:8080/cougarBaseline/v2/propertyEcho?propertyName=cougar.client.http.uuidparentsheader

the behaviour is somewhat unexpected for me because the extensions clearly
defines GET as the verb to use (file BaselineService-extensions line 33).

I'm thinking of a possible impl for cors to submit for your judgment and
it would be following the lines of
com.betfair.cougar.transport.jetty.GzipHandler. The issue with it is that
it would hijack the OPTIONS verb for cors handling and would break the
behaviour described above...


Reply to this email directly or view it on GitHub
#87 (comment).

from cougar.

jorgemsrs avatar jorgemsrs commented on August 20, 2024

It executes similar code paths. OPTIONS brings an additional Vary header

With OPTIONS

curl -v -X OPTIONS http://0:8080/cougarBaseline/v2/propertyEcho?propertyName=cougar.client.http.uuidparentsheader
* Adding handle: conn: 0x7fc863803000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fc863803000) send_pipe: 1, recv_pipe: 0
* About to connect() to 0 port 8080 (#0)
*   Trying 0.0.0.0...
* Connected to 0 (0.0.0.0) port 8080 (#0)
> OPTIONS /cougarBaseline/v2/propertyEcho?propertyName=cougar.client.http.uuidparentsheader HTTP/1.1
> User-Agent: curl/7.30.0
> Host: 0:8080
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Mon, 10 Nov 2014 13:40:30 GMT
* Server Cougar 2 - 3.2-SNAPSHOT is not blacklisted
< Server: Cougar 2 - 3.2-SNAPSHOT
< Cache-Control: no-cache
< Content-Type: application/json
< Content-Length: 16
< 
* Connection #0 to host 0 left intact
"X-UUID-Parents"

With GET

curl -v -X GET http://0:8080/cougarBaseline/v2/propertyEcho?propertyName=cougar.client.http.uuidparentsheader
* Adding handle: conn: 0x7f8503803000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7f8503803000) send_pipe: 1, recv_pipe: 0
* About to connect() to 0 port 8080 (#0)
*   Trying 0.0.0.0...
* Connected to 0 (0.0.0.0) port 8080 (#0)
> GET /cougarBaseline/v2/propertyEcho?propertyName=cougar.client.http.uuidparentsheader HTTP/1.1
> User-Agent: curl/7.30.0
> Host: 0:8080
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Mon, 10 Nov 2014 13:41:31 GMT
* Server Cougar 2 - 3.2-SNAPSHOT is not blacklisted
< Server: Cougar 2 - 3.2-SNAPSHOT
< Cache-Control: no-cache
< Content-Type: application/json
< Vary: Accept-Encoding, User-Agent
< Content-Length: 16
< 
* Connection #0 to host 0 left intact
"X-UUID-Parents"

from cougar.

jorgemsrs avatar jorgemsrs commented on August 20, 2024

a minimum working solution is open for discussion at #89. It has no tests. It should serve to see if the rationale is correctly adapted to the cougar reality.

from cougar.

eswdd avatar eswdd commented on August 20, 2024

@bfmike - do you have any concerns/thoughts from a security perspective on adding CORS support to Cougar?

I suggest that once this is added we deprecate the data frame solution and remove it in Cougar 4 (whenever that occurs).

from cougar.

eswdd avatar eswdd commented on August 20, 2024

All merged and tests passing.

from cougar.

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.