commit | 5093c4f8bd7be79d7c7cd3e00945190105ed9aab | [log] [tgz] |
---|---|---|
author | Neil Fuller <nfuller@google.com> | Thu Jul 31 17:48:03 2014 +0100 |
committer | Neil Fuller <nfuller@google.com> | Mon Aug 04 10:57:43 2014 +0100 |
tree | 55641be0ecd9226d07be5ea6ec7cc8e7ddecde2f | |
parent | c71b04eadf670c5252961767a90fe190c34d6f42 [diff] |
Apply okhttp upstream pull request #1011 Fix formatting / parsing for Android Ensuring that this Android bug is fixed for the next Android release: https://code.google.com/p/android/issues/detail?id=66135 On Android the SimpleDateFormat for "zzz" returns GMT+00:00. This is regrettable but awkward to change as it is existing behavior. https://code.google.com/p/android/issues/detail?id=66136 This change fixes the format to 'GMT'. This change also fixes a bug where the platform default timezone was used for parsing some date/times and not GMT. Various tests have been added to prove the behavior when timezones are missing and dates are malformed. (cherry picked from okhttp b36761b7dd5a0743ec5d89fb9adc36b602cc3b4b) Bug: https://code.google.com/p/android/issues/detail?id=66135 Change-Id: I831693bfff884c5d70f8592b47effd368a369859
An HTTP & SPDY client for Android and Java applications.
For more information please see the website.
Download the latest JAR or grab via Maven:
<dependency> <groupId>com.squareup.okhttp</groupId> <artifactId>okhttp</artifactId> <version>(insert latest version)</version> </dependency>
OkHttp requires Java 7 to build and run tests. Runtime compatibility with Java 6 is enforced as part of the build to ensure compliance with Android and older versions of the JVM.
Run OkHttp tests on the desktop with Maven. Running SPDY tests on the desktop uses Jetty-NPN which requires OpenJDK 7+.
mvn clean test
OkHttp's test suite creates an in-process HTTPS server. Prior to Android 2.3, SSL server sockets were broken, and so HTTPS tests will time out when run on such devices.
Test on a USB-attached Android using Vogar. Unfortunately dx
requires that you build with Java 6, otherwise the test class will be silently omitted from the .dex
file.
mvn clean mvn package -DskipTests vogar \ --classpath ~/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar \ --classpath mockwebserver/target/mockwebserver-2.0.0-SNAPSHOT.jar \ --classpath okhttp-protocols/target/okhttp-protocols-2.0.0-SNAPSHOT.jar \ --classpath okhttp/target/okhttp-2.0.0-SNAPSHOT.jar \ okhttp/src/test
A library for testing HTTP, HTTPS, HTTP/2.0, and SPDY clients.
MockWebServer coupling with OkHttp is essential for proper testing of SPDY and HTTP/2.0 so that code can be shared.
Download the latest JAR or grab via Maven:
<dependency> <groupId>com.squareup.okhttp</groupId> <artifactId>mockwebserver</artifactId> <version>(insert latest version)</version> <scope>test</scope> </dependency>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.