fix: check X-Forwarded-Proto for https detection
This commit is contained in:
		
							parent
							
								
									b535db6108
								
							
						
					
					
						commit
						94b2851984
					
				| 
						 | 
				
			
			@ -3,9 +3,8 @@ name: "Test"
 | 
			
		|||
 | 
			
		||||
# yamllint disable-line rule:truthy
 | 
			
		||||
on:
 | 
			
		||||
  {}
 | 
			
		||||
  # pull_request:
 | 
			
		||||
  # push:
 | 
			
		||||
  pull_request:
 | 
			
		||||
  push:
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  tests:
 | 
			
		||||
| 
						 | 
				
			
			@ -19,6 +18,6 @@ jobs:
 | 
			
		|||
      #     extraPullNames: devenv
 | 
			
		||||
      #     authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
 | 
			
		||||
      - name: Install devenv.sh
 | 
			
		||||
        run: nix profile install github:cachix/devenv/latest
 | 
			
		||||
        run: nix-env -if https://github.com/cachix/devenv/tarball/main
 | 
			
		||||
      - run: devenv shell echo ok
 | 
			
		||||
      - run: devenv ci
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ func (c *HomeController) Router(r chi.Router) {
 | 
			
		|||
 | 
			
		||||
func (c *HomeController) Index(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
	hx := htmx.New(w, r)
 | 
			
		||||
	isSecure := r.URL.Scheme == "https"
 | 
			
		||||
	isSecure := r.URL.Scheme == "https" || r.Header.Get("X-Forwarded-Proto") == "https"
 | 
			
		||||
 | 
			
		||||
	if hx.IsHtmxRequest() {
 | 
			
		||||
		hx.PushUrl("/")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue