@@ -287,6 +287,26 @@ START_TEST(test_proto_get_source_token_post)
287287 oauth2_cfg_source_token_free (_log , cfg );
288288
289289 oauth2_http_request_free (_log , request );
290+
291+ // also test for "application/x-www-form-urlencoded;charset=UTF-8" etc.;
292+ // see #72
293+
294+ request = oauth2_http_request_init (_log );
295+ oauth2_http_request_method_set (_log , request , OAUTH2_HTTP_METHOD_POST );
296+ oauth2_http_request_header_set (
297+ _log , request , "Content-Type" ,
298+ "application/x-www-form-urlencoded;charset=UTF-8" );
299+
300+ cfg = oauth2_cfg_source_token_init (_log );
301+ ck_assert_ptr_ne (cfg , NULL );
302+ rv = oauth2_cfg_source_token_set_accept_in (_log , cfg , "post" , NULL );
303+ ck_assert_ptr_eq (rv , NULL );
304+ token = oauth2_get_source_token (_log , cfg , request ,
305+ & _oauth2_check_proto_callbacks , NULL );
306+ ck_assert_ptr_ne (token , NULL );
307+ ck_assert_str_eq (token , my_post_token );
308+ oauth2_mem_free (token );
309+ oauth2_cfg_source_token_free (_log , cfg );
290310}
291311END_TEST
292312
0 commit comments