Skip to content

Commit 60bc679

Browse files
committed
fix of #489
1 parent 5bed2c8 commit 60bc679

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/services/FilesSearchService.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,12 @@ export class FilesSearchService {
144144
}
145145

146146
// Submit the request
147-
const apiUrl: string = `https://www.bingapis.com/api/v7/images/search?appid=${this.bingAPIKey}&traffictype=Internal_monitor&q=${encodeURIComponent(query)}&count=${maxResults}&aspect=${aspect}&maxFileSize=${maxFileSize}&mkt=en-US&size=${size}&license=${license}`;
148-
147+
const apiUrl: string = `https://api.cognitive.microsoft.com/bing/v7.0/images/search?traffictype=Internal_monitor&q=${encodeURIComponent(query)}&count=${maxResults}&aspect=${aspect}&maxFileSize=${maxFileSize}&mkt=en-US&size=${size}&license=${license}`;
148+
const headers = new Headers({
149+
'Ocp-Apim-Subscription-Key': this.bingAPIKey
150+
});
149151
const searchDataResponse: any = await this.context.httpClient.get(apiUrl, SPHttpClient.configurations.v1, {
150-
headers: new Headers(),
152+
headers: headers,
151153
method: 'GET',
152154
mode: 'cors'
153155
});

0 commit comments

Comments
 (0)