Index: google_analytics_api.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics_api/google_analytics_api.admin.inc,v
retrieving revision 1.11
diff -u -r1.11 google_analytics_api.admin.inc
--- google_analytics_api.admin.inc	17 Nov 2009 17:35:30 -0000	1.11
+++ google_analytics_api.admin.inc	17 Nov 2009 21:08:51 -0000
@@ -99,8 +99,7 @@
       variable_set('google_analytics_api_profile_id', $id);
     }
     drupal_set_message(t('You have granted access to your Google account. Drupal will be able to download information from the account until you revoke access.'));
-    header('Location: ' . gapiUrl::currentUrlWithoutGet());
-    exit;
+    drupal_goto(gapiUrl::currentUrlWithoutGet());
   }
   return google_analytics_api_current_token(TRUE);
 }
Index: tests/google_analytics_api_test.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics_api/tests/google_analytics_api_test.module,v
retrieving revision 1.4
diff -u -r1.4 google_analytics_api_test.module
--- tests/google_analytics_api_test.module	19 Aug 2009 06:58:25 -0000	1.4
+++ tests/google_analytics_api_test.module	17 Nov 2009 21:08:51 -0000
@@ -121,12 +121,7 @@
     }
 
     // Respond to request with a redirection.
-    $response = array('token' => GOOGLE_ANALYTICS_API_TEST_AUTH_TOKEN);
-    drupal_set_header('Content-Type', 'text/plain');
-    header('Location: ' . url($_GET['next'], array(
-      'query' => http_build_query($response, '', '&'),
-      'external' => TRUE)));
-    exit();
+    drupal_goto($_GET['next'], array('token' => GOOGLE_ANALYTICS_API_TEST_AUTH_TOKEN));
   }
 
   // Show the Grant/Deny access form.
