Commit a41d2835 authored by Ryan Diehl's avatar Ryan Diehl

Merge branch 'feature/properties' into 'develop'

fix(properties): bypass http interceptors

See merge request !36
parents ab21d3d9 a5fd1a0e
Pipeline #107581 passed with stages
in 4 minutes and 24 seconds
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { HttpBackend, HttpClient, HttpHeaders } from '@angular/common/http';
import { Inject, Injectable, Injector, Optional } from '@angular/core';
import { NO_CACHE_HEADER } from '@psu/utils/browser';
import { LoadingEvents } from '@psu/utils/loading-events';
......@@ -21,14 +21,19 @@ export class PropertiesService<T> {
public _properties: T;
private httpClient: HttpClient;
constructor(
private log: Logger,
private httpClient: HttpClient,
httpBackend: HttpBackend,
private injector: Injector,
@Optional()
@Inject(PROPERTIES_CONFIG)
private config: PropertiesConfig
) {}
) {
// NOTE: This bypasses all HTTP interceptors, by design.
this.httpClient = new HttpClient(httpBackend);
}
public load(appPropertyKey: string): Promise<T> {
const path = `${this.getBasePath()}${appPropertyKey}${propertiesExtension}`;
......@@ -37,12 +42,9 @@ export class PropertiesService<T> {
// params: {
// d: new Date().getTime().toString()
// },
headers: new HttpHeaders().append(NO_CACHE_HEADER, 'true')
headers: new HttpHeaders().append(NO_CACHE_HEADER, 'true'),
})
.pipe(
tap(this.extractData.bind(this)),
catchError(this.handleError.bind(this))
)
.pipe(tap(this.extractData.bind(this)), catchError(this.handleError.bind(this)))
.toPromise();
}
......
  • SonarQube analysis indicates that quality gate is failed.

    • Bugs is failed: Actual value 1 > 0
    • high_severity_vulns is passed: Actual value 0
    • medium_severity_vulns is passed: Actual value 0

    SonarQube analysis reported 13 issues

    • 1 major
    • 🔽 7 minor
    • 5 info

    Top 10 extra issues

    Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

    1. Unexpected empty source 📘
    2. 🔽 Add an "alt" attribute to this image. 📘
    3. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    4. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    5. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    6. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    7. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    8. 🔽 This assertion is unnecessary since it does not change the type of the expression. 📘
    9. Make sure that cookie is written safely here. 📘
    10. Make sure that using a regular expression is safe here. 📘
    • ... 3 more
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment