Skip to content

Commit 44e2d8b

Browse files
committed
Added functions change
1 parent ceed5ab commit 44e2d8b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/functions/src/service.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ describe('Firebase Functions > Service', () => {
4747
'http://localhost:5005/my-project/us-central1/foo'
4848
);
4949
});
50+
it('can use emulator with SSL', () => {
51+
service = createTestService(app);
52+
connectFunctionsEmulator(service, 'localhost', 5005, true);
53+
assert.equal(
54+
service._url('foo'),
55+
'https://localhost:5005/my-project/us-central1/foo'
56+
);
57+
});
5058

5159
it('correctly sets region', () => {
5260
service = createTestService(app, 'my-region');

packages/functions/src/service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ export class FunctionsService implements _FirebaseService {
172172
export function connectFunctionsEmulator(
173173
functionsInstance: FunctionsService,
174174
host: string,
175-
port: number
175+
port: number,
176+
ssl?: boolean
176177
): void {
177-
functionsInstance.emulatorOrigin = `http://${host}:${port}`;
178+
functionsInstance.emulatorOrigin = `http${ssl ? 's' : ''}://${host}:${port}`;
178179
}
179180

180181
/**

0 commit comments

Comments
 (0)