-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #33: Only listen to functionTarget. #81
Conversation
Could you also update the test? |
@hdp617 Addressed comment and fixed Travis CI tests. PTAL. |
test/invoker.ts
Outdated
@@ -34,7 +34,8 @@ describe('request to HTTP function', () => { | |||
(req: express.Request, res: express.Response) => { | |||
res.send(req.body.text.toUpperCase()); | |||
}, | |||
invoker.SignatureType.HTTP | |||
invoker.SignatureType.HTTP, | |||
'/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an odd function target. I suggest something like 'testFunction'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied suggestion of testFunction
.
test/invoker.ts
Outdated
@@ -34,7 +34,8 @@ describe('request to HTTP function', () => { | |||
(req: express.Request, res: express.Response) => { | |||
res.send(req.body.text.toUpperCase()); | |||
}, | |||
invoker.SignatureType.HTTP | |||
invoker.SignatureType.HTTP, | |||
'/' | |||
); | |||
return supertest(server) | |||
.post('/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.post('/'testFunction')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: This is a breaking change since we no longer invoke the function with /*
. Any GCF users relying on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied the suggestion of using a more useful path for the routing tests.
Question: This is a breaking change since we no longer invoke the function with /*. Any GCF users relying on this?
I don't believe GCF users are relying on this as its not possible to invoke the function at other URLs besides the functionTarget
GCF URL.
This should still be a major change as a request to /favicon.ico
will not invoke the function anymore (see original issue).
test/invoker.ts
Outdated
@@ -34,7 +34,8 @@ describe('request to HTTP function', () => { | |||
(req: express.Request, res: express.Response) => { | |||
res.send(req.body.text.toUpperCase()); | |||
}, | |||
invoker.SignatureType.HTTP | |||
invoker.SignatureType.HTTP, | |||
'/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied suggestion of testFunction
.
test/invoker.ts
Outdated
@@ -34,7 +34,8 @@ describe('request to HTTP function', () => { | |||
(req: express.Request, res: express.Response) => { | |||
res.send(req.body.text.toUpperCase()); | |||
}, | |||
invoker.SignatureType.HTTP | |||
invoker.SignatureType.HTTP, | |||
'/' | |||
); | |||
return supertest(server) | |||
.post('/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
*
.