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

fix: Use port 80 to get better headers for Codespaces, fixes #6102 #6398

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

rfay
Copy link
Member

@rfay rfay commented Jul 15, 2024

The Issue

Handling ports in HTTP is always a little complex, port 80 is default for http, port 443 for https. Codespaces seems to handle the Host header and X-Forwarded-Host incorrectly when it's forwarding a nonstandard (not port 80) port.

How This PR Solves The Issue

Use port 80 by default in codespaces. This seems to do no harm. It affects only Codespaces.

Manual Testing Instructions

  • Run this PR in Codespaces
  • Start a project
  • Install Drupal 10
  • Log in. If it works, it's fixed

Copy link

github-actions bot commented Jul 15, 2024

Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

I moved the condition because it broke Gitpod.
And I haven't tested Codespaces yet.

pkg/ddevapp/ddevapp.go Show resolved Hide resolved
pkg/ddevapp/ddevapp.go Outdated Show resolved Hide resolved
pkg/ddevapp/ddevapp.go Outdated Show resolved Hide resolved
@rfay rfay force-pushed the 20240714_rfay_codespaces_http_port branch from 19b5095 to d1391fb Compare July 15, 2024 13:18
@rfay
Copy link
Member Author

rfay commented Jul 15, 2024

Open to your suggestions, thanks for catching the copy/paste failure.

@rfay rfay marked this pull request as ready for review July 15, 2024 14:36
@rfay rfay requested a review from a team as a code owner July 15, 2024 14:36
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

Tested it with Drupal 10, login works.

It is mind-blowing how tricky the cloud can be 🤯

@rfay rfay merged commit 8f0ff8c into ddev:master Jul 15, 2024
23 checks passed
@rfay rfay deleted the 20240714_rfay_codespaces_http_port branch July 15, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants