Guest User

Untitled

a guest
May 23rd, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. $.ajax({
  2. url : url,
  3. dataType : 'html',
  4. success : function(data, status, xhr) {
  5. $(dataContainer).append(data);
  6. },
  7. complete: function(xhr, status, error) {
  8. if (xhr.status != 200) {
  9. $.logger(xhr.getResponseHeader('Location'));
  10. }
  11. }
  12. });
  13.  
  14. $.ajax({
  15. xhrFields: { withCredentials: true },
  16. url : url,
  17. dataType : 'html',
  18. success : function(data, status, xhr) {
  19. $(dataContainer).append(data);
  20. },
  21. complete: function(xhr, status, error) {
  22. if (xhr.status != 200) {
  23. $.logger(xhr.getResponseHeader('Location'));
  24. }
  25. }
  26. });
  27.  
  28. response.setHeader("Access-Control-Allow-Origin", "*");
  29. response.setHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS");
  30. response.setHeader("Access-Control-Max-Age", "1728000");
  31. response.setHeader("Access-Control-Allow-Headers", "Cookie,X-Requested-With");
  32. response.setHeader("Access-Control-Allow-Credentials", "true");
  33. response.setHeader("Access-Control-Expose-Headers", "Location");
  34.  
  35. response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
  36.  
  37. $.ajax({
  38. xhrFields: { withCredentials: true },
  39. url : url,
  40. dataType : 'html',
  41. crossDomain: true,
  42. success : function(data, status, xhr) {
  43. $(dataContainer).append(data);
  44. },
  45. complete: function(xhr, status, error) {
  46. if (xhr.status != 200) {
  47. $.logger(xhr.getResponseHeader('Location'));
  48. }
  49. }
  50. });
  51.  
  52. jQuery.support.cors = true;
  53.  
  54. param.async = true;
  55. param.xhrFields = { withCredentials: true };
  56. param.crossDomain = true,
  57. param.processData = false;
  58. param.headers = {
  59. "content-type":"application/json",
  60. "cache-control": "no-cache",
  61. }
  62.  
  63. var request = $.ajax(param);
  64.  
  65. request.done(function( result,status,xhr ){
  66. console.log(xhr.getResponseHeader("Location"));
  67. });
  68.  
  69. Cache-control: no-cache, no-store
  70. Connection: keep-alive
  71. Content-Length: 1403
  72. Content-Type: text/html; charset=utf-8
  73. Date: Wed, 23 May 2018 05:23:14 GMT
  74. Location: https://accounts.google.com/o/oauth2/v2/auth?state=<my state code>&redirect_uri=<my redirect url>&prompt=select_account&response_type=code&client_id=<my client id>&scope=<my scope>&access_type=online
  75. Server: nginx/1.4.6 (Ubuntu)
  76. X-Content-Type-Options: nosniff
Add Comment
Please, Sign In to add comment