Re: Review Request 40905: [libprocess]: Made `MethodNotAllowed` response compliant to RFC 2616.

2015-12-11 Thread Alexander Rukletsov


> On Dec. 3, 2015, 5:10 p.m., Anand Mazumdar wrote:
> > 3rdparty/libprocess/include/process/http.hpp, line 582
> > 
> >
> > hmmm , why do we need another constructor with no response body ?
> > 
> > We have already seen previous bugs from end-users about us not setting 
> > `Content-Type` for some error `Response` types like `BadRequest`. Hence, 
> > empty body responses should be avoided at best unless I am missing 
> > something ?
> 
> Alexander Rukletsov wrote:
> I followed the pattern we use for other response types. I think we should 
> clean it up at once in a separate patch.

Filed https://issues.apache.org/jira/browse/MESOS-4127


- Alexander


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


On Dec. 10, 2015, 12:12 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40905/
> ---
> 
> (Updated Dec. 10, 2015, 12:12 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Joris Van 
> Remoortere.
> 
> 
> Bugs: MESOS-4056
> https://issues.apache.org/jira/browse/MESOS-4056
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to RFC 2616 
> (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7), 
> `MethodNotAllowed` response must include an 'Allow' header containing a list 
> of valid methods.
> 
> This is a libprocess change only.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/http.hpp 
> 3f33b46527e07ed73621e07e9c5d40594e32f6a9 
> 
> Diff: https://reviews.apache.org/r/40905/diff/
> 
> 
> Testing
> ---
> 
> This a libprocess change only. The code does not compile without the 
> follow-up [mesos] patch https://reviews.apache.org/r/40913/.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 40905: [libprocess]: Made `MethodNotAllowed` response compliant to RFC 2616.

2015-12-10 Thread Joris Van Remoortere

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

Ship it!


Ship It!

- Joris Van Remoortere


On Dec. 10, 2015, 12:12 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40905/
> ---
> 
> (Updated Dec. 10, 2015, 12:12 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Joris Van 
> Remoortere.
> 
> 
> Bugs: MESOS-4056
> https://issues.apache.org/jira/browse/MESOS-4056
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to RFC 2616 
> (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7), 
> `MethodNotAllowed` response must include an 'Allow' header containing a list 
> of valid methods.
> 
> This is a libprocess change only.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/http.hpp 
> 3f33b46527e07ed73621e07e9c5d40594e32f6a9 
> 
> Diff: https://reviews.apache.org/r/40905/diff/
> 
> 
> Testing
> ---
> 
> This a libprocess change only. The code does not compile without the 
> follow-up [mesos] patch https://reviews.apache.org/r/40913/.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 40905: [libprocess]: Made `MethodNotAllowed` response compliant to RFC 2616.

2015-12-09 Thread Alexander Rukletsov


> On Dec. 3, 2015, 5:10 p.m., Anand Mazumdar wrote:
> > 3rdparty/libprocess/include/process/http.hpp, line 582
> > 
> >
> > hmmm , why do we need another constructor with no response body ?
> > 
> > We have already seen previous bugs from end-users about us not setting 
> > `Content-Type` for some error `Response` types like `BadRequest`. Hence, 
> > empty body responses should be avoided at best unless I am missing 
> > something ?

I followed the pattern we use for other response types. I think we should clean 
it up at once in a separate patch.


- Alexander


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


On Dec. 3, 2015, 2:34 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40905/
> ---
> 
> (Updated Dec. 3, 2015, 2:34 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Joris Van 
> Remoortere.
> 
> 
> Bugs: MESOS-4056
> https://issues.apache.org/jira/browse/MESOS-4056
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to RFC 2616 
> (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7), 
> `MethodNotAllowed` response must include an 'Allow' header containing a list 
> of valid methods.
> 
> This is a libprocess change only.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/http.hpp 
> c7d19a2086a8891d0198dce1c4d1c92bd99ac6e3 
> 
> Diff: https://reviews.apache.org/r/40905/diff/
> 
> 
> Testing
> ---
> 
> This a libprocess change only. The code does not compile without the 
> follow-up [mesos] patch https://reviews.apache.org/r/40913/.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 40905: [libprocess]: Made `MethodNotAllowed` response compliant to RFC 2616.

2015-12-09 Thread Anand Mazumdar

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

Ship it!


LGTM

- Anand Mazumdar


On Dec. 10, 2015, 12:12 a.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40905/
> ---
> 
> (Updated Dec. 10, 2015, 12:12 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Joris Van 
> Remoortere.
> 
> 
> Bugs: MESOS-4056
> https://issues.apache.org/jira/browse/MESOS-4056
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to RFC 2616 
> (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7), 
> `MethodNotAllowed` response must include an 'Allow' header containing a list 
> of valid methods.
> 
> This is a libprocess change only.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/http.hpp 
> 3f33b46527e07ed73621e07e9c5d40594e32f6a9 
> 
> Diff: https://reviews.apache.org/r/40905/diff/
> 
> 
> Testing
> ---
> 
> This a libprocess change only. The code does not compile without the 
> follow-up [mesos] patch https://reviews.apache.org/r/40913/.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 40905: [libprocess]: Made `MethodNotAllowed` response compliant to RFC 2616.

2015-12-03 Thread Guangya Liu


> On Dec. 3, 2015, 12:24 p.m., Guangya Liu wrote:
> > src/master/http.cpp, line 385
> > 
> >
> > What about update to 
> > 
> > Expecting a 'POST' request, received a '" + request.method + "' request"
> 
> Alexander Rukletsov wrote:
> Do you think it adds extra information?
> 
> I think the message is consice and fits in one line. Also technically, 
> 'POST' is not a request, it's a method (or http verb).

I think that the POST, DELETE, GET, PUT can all be treated as HTTP request ;-)

Using "Expecting a 'POST' request, received a '" + request.method + "' 
request"" does not add extra information, but just make the message clear and 
official.


- Guangya


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


On Dec. 3, 2015, 2:34 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40905/
> ---
> 
> (Updated Dec. 3, 2015, 2:34 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Joris Van 
> Remoortere.
> 
> 
> Bugs: MESOS-4056
> https://issues.apache.org/jira/browse/MESOS-4056
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to RFC 2616 
> (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7), 
> `MethodNotAllowed` response must include an 'Allow' header containing a list 
> of valid methods.
> 
> This is a libprocess change only.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/http.hpp 
> c7d19a2086a8891d0198dce1c4d1c92bd99ac6e3 
> 
> Diff: https://reviews.apache.org/r/40905/diff/
> 
> 
> Testing
> ---
> 
> This a libprocess change only. The code does not compile without the 
> follow-up [mesos] patch https://reviews.apache.org/r/40913/.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>



Re: Review Request 40905: [libprocess]: Made `MethodNotAllowed` response compliant to RFC 2616.

2015-12-03 Thread Alexander Rukletsov

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

(Updated Dec. 3, 2015, 2:34 p.m.)


Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Joris Van 
Remoortere.


Changes
---

Split into [libprocess] and [mesos] patches.


Summary (updated)
-

[libprocess]: Made `MethodNotAllowed` response compliant to RFC 2616.


Bugs: MESOS-4056
https://issues.apache.org/jira/browse/MESOS-4056


Repository: mesos


Description (updated)
---

According to RFC 2616 
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7), 
`MethodNotAllowed` response must include an 'Allow' header containing a list of 
valid methods.

This is a libprocess change only.


Diffs (updated)
-

  3rdparty/libprocess/include/process/http.hpp 
c7d19a2086a8891d0198dce1c4d1c92bd99ac6e3 

Diff: https://reviews.apache.org/r/40905/diff/


Testing (updated)
---

This a libprocess change only. The code does not compile without the follow-up 
[mesos] patch https://reviews.apache.org/r/40913/.


Thanks,

Alexander Rukletsov



Re: Review Request 40905: [libprocess]: Made `MethodNotAllowed` response compliant to RFC 2616.

2015-12-03 Thread Anand Mazumdar

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


LGTM, Just one minor suggestion + a query regarding why do we need the 
additional constructor without a `Response` body.


3rdparty/libprocess/include/process/http.hpp (line 582)


hmmm , why do we need another constructor with no response body ?

We have already seen previous bugs from end-users about us not setting 
`Content-Type` for some error `Response` types like `BadRequest`. Hence, empty 
body responses should be avoided at best unless I am missing something ?



3rdparty/libprocess/include/process/http.hpp (line 588)


s/std::vector/std::initializer_list

An initializer list is better suited for this constructor since we hardly 
need any `std::vector` operations. I am assuming `strings::join(...)` plays 
well with it too ?


- Anand Mazumdar


On Dec. 3, 2015, 2:34 p.m., Alexander Rukletsov wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40905/
> ---
> 
> (Updated Dec. 3, 2015, 2:34 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Isabel Jimenez, and Joris Van 
> Remoortere.
> 
> 
> Bugs: MESOS-4056
> https://issues.apache.org/jira/browse/MESOS-4056
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to RFC 2616 
> (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.7), 
> `MethodNotAllowed` response must include an 'Allow' header containing a list 
> of valid methods.
> 
> This is a libprocess change only.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/http.hpp 
> c7d19a2086a8891d0198dce1c4d1c92bd99ac6e3 
> 
> Diff: https://reviews.apache.org/r/40905/diff/
> 
> 
> Testing
> ---
> 
> This a libprocess change only. The code does not compile without the 
> follow-up [mesos] patch https://reviews.apache.org/r/40913/.
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>