Project

General

Profile

« Previous | Next » 

Revision 55005

[Trunk|Library]: CustomOptions.class.ts: clear code

View differences:

customOptions.class.ts
2 2
import { COOKIE  } from '../../login/utils/helper.class';
3 3

  
4 4

  
5
export class CustomOptions{
6
  public static getAuthOptionsWithBody():RequestOptions{
7
  let headers = new Headers();
8
  headers.append('Content-Type', 'application/json');
9
  headers.append('X-XSRF-TOKEN',  COOKIE.getCookie(COOKIE.cookieName_id));
10
  let options = new RequestOptions({ headers: headers, withCredentials:true });
5
export class CustomOptions {
6

  
7
  public static getAuthOptionsWithBody(): RequestOptions {
8
    const headers = new Headers();
9
    headers.append('Content-Type', 'application/json');
10
    headers.append('X-XSRF-TOKEN',  COOKIE.getCookie(COOKIE.cookieName_id));
11
    const options = new RequestOptions({ headers: headers, withCredentials: true });
11 12
    return options;
12 13
  }
13
  public static getAuthOptions():RequestOptions{
14
  let headers = new Headers();
15
  headers.append('X-XSRF-TOKEN',  COOKIE.getCookie(COOKIE.cookieName_id));
16
  let options = new RequestOptions({ headers: headers, withCredentials:true });
14

  
15
  public static getAuthOptions(): RequestOptions {
16
    const headers = new Headers();
17
    headers.append('X-XSRF-TOKEN',  COOKIE.getCookie(COOKIE.cookieName_id));
18
    const options = new RequestOptions({ headers: headers, withCredentials: true });
17 19
    return options;
18 20
  }
21

  
19 22
}

Also available in: Unified diff