-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37403/#review95135
-----------------------------------------------------------


Mainly comments around us having "Accept" header validations for all types of 
calls and not just Subscribe.


src/master/http.cpp (line 383)
<https://reviews.apache.org/r/37403/#comment149957>

    Remove this TODO now.



src/master/http.cpp (line 384)
<https://reviews.apache.org/r/37403/#comment149959>

    How about ?
    
    // Default to sending back JSON.
    ContentType responseContentType = ContentType::JSON;
    
    if(request.acceptsMediaType(protobuf) {
      responseContent = ContentType::PROTOBUF;
    } else if(request.acceptsMediaType(json)) {
      responseContent = ContentType::JSON;
    } else {
      // return error
    }



src/master/http.cpp (line 391)
<https://reviews.apache.org/r/37403/#comment149960>

    Check my earlier comment on how we can simplify this. Also , we need to do 
Accept header validations for ALL call types and not just subscribe.



src/master/http.cpp (line 394)
<https://reviews.apache.org/r/37403/#comment149970>

    How about just:
    
    Unsupported 'blah_blah' media type in 'Accept' request-header. The 
supported media types are 'application/json' and 'application/x-protobuf' ?



src/master/http.cpp (line 395)
<https://reviews.apache.org/r/37403/#comment149969>

    This would crash if there was no accept header specified ?



src/tests/http_api_tests.cpp (line 563)
<https://reviews.apache.org/r/37403/#comment149966>

    Add another test-case when there is no accept header set. We should not 
receive a error and response should be "OK"
    
    Also add another test-case for some other call other then subscribe.
    
    When accept header is "*/*"



src/tests/http_api_tests.cpp (line 567)
<https://reviews.apache.org/r/37403/#comment149962>

    nit : new line



src/tests/http_api_tests.cpp (line 575)
<https://reviews.apache.org/r/37403/#comment149963>

    Remove this comment, it's not needed only for subscribe type



src/tests/http_api_tests.cpp (line 581)
<https://reviews.apache.org/r/37403/#comment149964>

    kill the new line, have this block with the earlier line and then put a new 
line before string body;



src/tests/http_api_tests.cpp (line 583)
<https://reviews.apache.org/r/37403/#comment149965>

    use the serialize function already defined earlier in the text fixture.


- Anand Mazumdar


On Aug. 12, 2015, 5:50 p.m., Isabel Jimenez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37403/
> -----------------------------------------------------------
> 
> (Updated Aug. 12, 2015, 5:50 p.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-2497
>     https://issues.apache.org/jira/browse/MESOS-2497
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Using AcceptMediaType Request method to validate request 'Accept' HTTP header 
> in Scheduler HTTP API
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp 579c009 
>   src/tests/http_api_tests.cpp aef3c4b 
> 
> Diff: https://reviews.apache.org/r/37403/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Isabel Jimenez
> 
>

Reply via email to