Closed odinliu closed 7 years ago
fix HttpHeaders's Date locale problem
It comes again in v2.4. I think this could fix this problem:
diff --git a/http/src/main/scala/com/twitter/finatra/http/filters/HttpResponseFilter.scala b/http/src/main/scala/com/twitter/finatra/http/filters/HttpResponseFilter.scala index 2ef3126..21e8b51 100644 --- a/http/src/main/scala/com/twitter/finatra/http/filters/HttpResponseFilter.scala +++ b/http/src/main/scala/com/twitter/finatra/http/filters/HttpResponseFilter.scala @@ -6,6 +6,7 @@ import com.twitter.finagle.{Service, SimpleFilter} import com.twitter.finatra.http.HttpHeaders import com.twitter.finatra.http.request.RequestUtils import com.twitter.util.{ScheduledThreadPoolTimer, Future} +import java.util.Locale import java.util.TimeZone import javax.inject.Singleton import org.apache.commons.lang.time.FastDateFormat @@ -19,7 +20,8 @@ import org.apache.commons.lang.time.FastDateFormat class HttpResponseFilter[R <: Request] extends SimpleFilter[R, Response] { // optimized - private val dateFormat = FastDateFormat.getInstance(HttpHeaders.RFC7231DateFormat, TimeZone.getTimeZone("GMT")) + private val dateFormat = FastDateFormat.getInstance( + HttpHeaders.RFC7231DateFormat, TimeZone.getTimeZone("GMT"), Locale.US) @volatile private var currentDateValue: String = getCurrentDateValue() new ScheduledThreadPoolTimer( poolSize = 1,
@odinliu 👍
@cacoco Submit a pr yet. Hopes this can be fixed in next release.
fix HttpHeaders's Date locale problem
It comes again in v2.4. I think this could fix this problem: