-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from VNG-Realisatie/issue/#104-bug-fixes
Bug fixes reported in #104
- Loading branch information
Showing
5 changed files
with
32 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package v1 | ||
|
||
import "net/http" | ||
|
||
const ( | ||
productionHostName string = "referentielijsten-api.vng.cloud" | ||
// currently we do not have a test server but this is for future proofing | ||
testHostName string = "referentielijsten-api.test.vng.cloud" | ||
) | ||
|
||
// getScheme determines the scheme used for building up a url | ||
// currently the apis do not run on https -> they will always return http when running on kube | ||
// for production this scheme should always be https | ||
func getScheme(req *http.Request) string { | ||
scheme := "http://" | ||
if req.TLS != nil || req.Host == productionHostName || req.Host == testHostName { | ||
scheme = "https://" | ||
} | ||
|
||
return scheme | ||
} |