openfaas / of-watchdog

Reverse proxy for STDIO and HTTP microservices
MIT License
259 stars 115 forks source link

Implement proposal 716, passing full paths through of-watchdog #21

Closed telackey closed 5 years ago

telackey commented 5 years ago

An implementation of proposal #716, passing the full URL through the of-watchdog.

Description

Previous to these changes, only the query string provide by the HTTP client was passed through to the handling code. With these changes, the full URL path is passed as well as the query string.

Motivation and Context

Proposal #716

How Has This Been Tested?

Manually.

Types of changes

Some of the templates have baked in routes of '/' (cf. the node8 template). Those will also need updated. The easiest will be to replace the explicit '/' route with a catchall:

-app.post('/', middleware);
-app.get('/', middleware);
+app.post('/*', middleware);
+app.get('/*', middleware);

Checklist:

This may or may not require a documentation change. The existing documentation, AFAIK, does not address the use of paths one way or the other.

Refs

Trello: https://trello.com/c/1qZMlGXU

alexellis commented 5 years ago

@telackey I'd like to see unit tests for this, but will merge and if there are any problems get in touch for a correction.

Alex

telackey commented 5 years ago

@alexellis Sounds good.

alexellis commented 5 years ago

This has been released along with the gateway and the node template. You should be able to move off your patches now. Looking forward to catching up soon.