title: CORS Angular 8 it gives me
body: <p>I have a CORS problem in my project. From Angular 8 I do:</p>
  
  <pre><code> httpOptions = { 
        headers: new HttpHeaders({
          'Content-Type':'application/json',
          'Authorization':'Basic bm92Z*********************'
        })
      };
  </code></pre>
  
  <p>and I do get operation in this way:</p>
  
  <pre><code>public getStudents() : Observable&lt;IStudent[]&gt;{
    return this.http.get&lt;IStudent[]&gt;(this.writeUrl, this.httpOptions)...// this.writeUrl is the request  url
  }
  </code></pre>
  
  <p>In my server with java I do:</p>
  
  <pre><code>public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) {
  
      responseContext.getHeaders().add("Access-Control-Allow-Origin", "*");
      responseContext.getHeaders().add("Access-Control-Allow-Headers",
      "origin, content-type, accept, authorization");
      responseContext.getHeaders().add("Access-Control-Allow-Credentials", "true");
      responseContext.getHeaders().add("Access-Control-Allow-Methods",
      "GET, POST, PUT, DELETE, OPTIONS, HEAD");
  
      }
  </code></pre>
  
  <p>it gives me CORS and I don't know why, anyone can help me?</p>