Skip to content

Commit

Permalink
Remove the authorization header from the pass throught container vali…
Browse files Browse the repository at this point in the history
…dation api (#3220)

* remove the authorization header from the pass throught container validation api

* add an empty header object
  • Loading branch information
nertim authored and ehamai committed Sep 23, 2018
1 parent c117b53 commit 65c395b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { UserService } from '../../../shared/services/user.service';
import { ConditionalHttpClient, Result } from '../../../shared/conditional-http-client';
import { ProxyRequest, GetRepositoryTagRequest } from '../container-settings';
import { Constants } from '../../../shared/models/constants';
import { Headers } from '@angular/http';

@Injectable()
export class ContainerValidationService {
Expand Down Expand Up @@ -33,13 +34,16 @@ export class ContainerValidationService {
headers: {},
};

const headers = new Headers();
headers.append('Content-Type', 'application/json');

const validateImage = this._userService
.getStartupInfo()
.first()
.switchMap(i => {
proxyRequest.headers['Authorization'] = `Bearer ${i.token}`;
return this._cacheService
.post('/api/validateContainerImage', true, null, proxyRequest)
.post('/api/validateContainerImage', true, headers, proxyRequest)
.map(r => r.json());
});

Expand Down

0 comments on commit 65c395b

Please sign in to comment.