Skip to content
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

Refactor and test middleware #32

Merged
merged 4 commits into from
Aug 26, 2022
Merged

Refactor and test middleware #32

merged 4 commits into from
Aug 26, 2022

Conversation

krzysztofwolski
Copy link
Member

Closes #29

  • split middleware into separate files
  • add tests to existing middleware
  • JWT middleware is not tested, and require more testing infrastructure (polly) to mock external requests ( issue Test JWT middleware  #31 )

@krzysztofwolski krzysztofwolski changed the title Refactor middlewares Refactor and test middleware Aug 25, 2022
@krzysztofwolski krzysztofwolski requested review from lkostrowski and a team August 25, 2022 15:49
Base automatically changed from apl-interface to main August 25, 2022 17:45
import { Middleware } from "retes";

export const withBaseURL: Middleware = (handler) => async (request) => {
const { host, "x-forwarded-proto": protocol = "http" } = request.headers;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know its not a scope of refactor, but why http, not https?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC it's assuming http because of Docker routing.

@krzysztofwolski krzysztofwolski merged commit 4a51410 into main Aug 26, 2022
@krzysztofwolski krzysztofwolski deleted the refactor-middlewares branch August 26, 2022 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update file structure for the middlewares
2 participants