Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 2.31 KB

codespaces.md

File metadata and controls

57 lines (43 loc) · 2.31 KB

Codespaces

GitHub Codespaces is convenient, but has a few things to be aware of, and some changes that might need changing to work well.

Personalisation

It's worth exploring the supported customisation options provided for tools you might want, or VS Code settings.

Disabling CSRF for Rails (and other similar tools)

The Origin header is incorrectly rewritten, which leads to certain requests failing. This seems to be something Codespaces isn't going to fix, so it needs to be worked around. In Rails, for example:

# config/environments/development.rb
if ENV["GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN"] == "app.github.dev"
    warn "WARNING: (development) Disabling CSRF protection Origin header check!"
    config.action_controller.forgery_protection_origin_check = false
end

GitHub Community Post

401 Unauthorized responses over shared ports

Sometimes, an opened port still returns a 401 Unauthorized response even when everything else is configured correctly.

You might be able to resolve this by making the shared port "public" and then switching back to "private". This then seems to work as expected for the rest of the session.

GitHub Community Post.

Other problems