You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@aurora.apache.org by Kevin Sweeney <ke...@apache.org> on 2015/07/02 03:04:28 UTC

Re: Review Request 36064: Perform leader redirect using HTTP status code 307

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

Ship it!



src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java (line 46)
<https://reviews.apache.org/r/36064/#comment143178>

    Use the `HttpHeaders.LOCATION` constant here instead.


- Kevin Sweeney


On June 30, 2015, 1:44 p.m., Stephan Erb wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36064/
> -----------------------------------------------------------
> 
> (Updated June 30, 2015, 1:44 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Kevin Sweeney.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Perform leader redirect using HTTP status code 307.
> 
> The scheduler used to redirect to its leading master using the HTTP status code `302 Found`. Many browsers (including utilities like curl and python requests) implement this status code wrongly. They are changing all PUT and POST requests to GET (see https://en.wikipedia.org/wiki/HTTP_302). By using the the new HTTP/1.1 code `307 Temporary Redirect` we remedy this situation.
> 
> Aurora is already using status code `307` within the MNAME-Feature. By using it also for the leader redirect, we enable users to run commands like `curl -X PUT http://non-leading-master/mname/...`
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java 1c2b08de1e2c470d32baeb845ae0e0a7ce2b75aa 
>   src/test/java/org/apache/aurora/scheduler/http/ServletFilterTest.java f8b134fa1f3fbbd7affef31acb077e7acd4f9761 
> 
> Diff: https://reviews.apache.org/r/36064/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew -Pq build
> 
> 
> Thanks,
> 
> Stephan Erb
> 
>