From 3b056b322669e334c40eb1d4bd2f7cb0739420bd Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 9 Mar 2010 20:33:00 +0000 Subject: [PATCH] Monotone-Parent: bcb224398f8aef1d62aad42e31635b91c0c993f7 Monotone-Revision: 01c5e5314c26ef13463ba2e2dec3d854ef793f1d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-03-09T20:33:00 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Common/WODirectAction+SOGo.m | 9 +++++++-- UI/MainUI/SOGoRootPage.m | 9 ++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca5a7531a..d272b7364 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-03-09 Wolfgang Sourdeau + * UI/Common/WODirectAction+SOGo.m + (-responseWithStatus:andJSONRepresentation:): we now add the + "application/json" content type to the response object. + * UI/SOGoUI/UIxComponent.m (-responseWithStatus:andJSONRepresentation:): we now add the "application/json" content type to the response object. diff --git a/UI/Common/WODirectAction+SOGo.m b/UI/Common/WODirectAction+SOGo.m index 0e7e40001..8eec9cd75 100644 --- a/UI/Common/WODirectAction+SOGo.m +++ b/UI/Common/WODirectAction+SOGo.m @@ -60,8 +60,13 @@ - (WOResponse *) responseWithStatus: (unsigned int) status andJSONRepresentation: (NSObject *) contentObject; { - return [self responseWithStatus: status - andString: [contentObject jsonRepresentation]]; + WOResponse *response; + + response = [self responseWithStatus: status + andString: [contentObject jsonRepresentation]]; + [response setHeader: @"application/json" forKey: @"content-type"]; + + return response; } - (WOResponse *) responseWith204 diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index 9d66825fb..a1da79fcb 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -113,18 +113,13 @@ /* actions */ - (WOResponse *) _responseWithLDAPPolicyError: (int) error { - WOResponse *response; NSDictionary *jsonError; jsonError = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: error] forKey: @"LDAPPasswordPolicyError"]; - response = [self responseWithStatus: 403 - andJSONRepresentation: jsonError]; - [response setHeader: @"application/json" - forKey: @"content-type"]; - - return response; + return [self responseWithStatus: 403 + andJSONRepresentation: jsonError]; } - (id ) connectAction