mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-30 01:48:14 +00:00 
			
		
		
		
	Add accept language header to all requests
This commit is contained in:
		
							parent
							
								
									f7d4d27ebb
								
							
						
					
					
						commit
						c429b575a9
					
				| @ -43,6 +43,7 @@ import timber.log.Timber; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.util.List; | ||||
| import java.util.Locale; | ||||
| 
 | ||||
| import static com.owncloud.android.lib.common.http.HttpConstants.AUTHORIZATION_HEADER; | ||||
| import static com.owncloud.android.lib.common.http.HttpConstants.HTTP_MOVED_PERMANENTLY; | ||||
| @ -128,6 +129,7 @@ public class OwnCloudClient extends HttpClient { | ||||
|             Timber.d("Executing in request with id %s", requestId); | ||||
|             method.setRequestHeader(HttpConstants.OC_X_REQUEST_ID, requestId); | ||||
|             method.setRequestHeader(HttpConstants.USER_AGENT_HEADER, SingleSessionManager.getUserAgent()); | ||||
|             method.setRequestHeader(HttpConstants.ACCEPT_LANGUAGE_HEADER, Locale.getDefault().getLanguage()); | ||||
|             method.setRequestHeader(HttpConstants.ACCEPT_ENCODING_HEADER, HttpConstants.ACCEPT_ENCODING_IDENTITY); | ||||
|             if (mCredentials.getHeaderAuth() != null && !mCredentials.getHeaderAuth().isEmpty()) { | ||||
|                 method.setRequestHeader(AUTHORIZATION_HEADER, mCredentials.getHeaderAuth()); | ||||
|  | ||||
| @ -40,6 +40,7 @@ public class HttpConstants { | ||||
|     public static final String IF_MATCH_HEADER = "If-Match"; | ||||
|     public static final String IF_NONE_MATCH_HEADER = "If-None-Match"; | ||||
|     public static final String CONTENT_TYPE_HEADER = "Content-Type"; | ||||
|     public static final String ACCEPT_LANGUAGE_HEADER = "Accept-Language"; | ||||
|     public static final String CONTENT_LENGTH_HEADER = "Content-Length"; | ||||
|     public static final String OC_TOTAL_LENGTH_HEADER = "OC-Total-Length"; | ||||
|     public static final String OC_X_OC_MTIME_HEADER = "X-OC-Mtime"; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user