> On Oct. 8, 2018, 10:49 a.m., Benno Evers wrote:
> > 3rdparty/libprocess/include/process/http.hpp
> > Lines 777 (patched)
> > <https://reviews.apache.org/r/68945/diff/2/?file=2095314#file2095314line784>
> >
> > I'd probably consider using `strings::format()` here.
It is indeed a bit nicer, but I'd say the readability benefit does not outweigh
the cost of including an extra header.
```
"405 Method Not Allowed. Expecting one of { '" +
strings::join("', '", allowedMethods) + "' }" +
(requestMethod.isSome()
? ", but received '" + requestMethod.get() + "'"
: "") +
".";
```
vs.
```
strings::format(
"405 Method Not Allowed. Expecting one of { '%s' }%s.",
strings::join("', '", allowedMethods),
requestMethod.isSome()
? ", but received '" + requestMethod.get() + "'"
: "");
```
- Alexander
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68945/#review209305
-----------------------------------------------------------
On Oct. 8, 2018, 7:50 a.m., Alexander Rukletsov wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68945/
> -----------------------------------------------------------
>
> (Updated Oct. 8, 2018, 7:50 a.m.)
>
>
> Review request for mesos and Benno Evers.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> There is no good reason to provide two c-tors for `MethodNotAllowed`,
> with one taking `requestMethod` and one not. Instead, an `Option<>`
> can be used. This also removes the need for copy-paste in the c-tor
> body.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/include/process/http.hpp
> cef511a1563a26e170ce7f4a49de12776b4512e7
>
>
> Diff: https://reviews.apache.org/r/68945/diff/2/
>
>
> Testing
> -------
>
> `make check` on various linux distros
>
>
> Thanks,
>
> Alexander Rukletsov
>
>