I'm using spring-boot:1.3.3, spring-hateoas:0.19.0 and spring-data-rest-core:2.4.4.
{
  "_embedded" : {
    "projects" : [ {
      "status" : "ACTIVE",
      "storageRegion" : "US",
      "dataSize" : 96850,
      "freemiumUnits" : 1,
      "_links" : {
        "self" : {
          "href" : "http://example.com/x-region-us/api/data/projects/2c9f93b755359a4a015535c19b1f0006"
        },
        "project" : {
          "href" : "http://example.com/x-region-us/api/data/projects/2c9f93b755359a4a015535c19b1f0006"
        },
This is example of content served by spring-hateoas. After a while I switched my application to SSL.
Problem comes when using traverson.js to jump(hop) through "_links". Error occures:
traverson.min.js:2 Mixed Content: The page at 'https://example.com/project-new' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://example.com/x-region-us/api/data/submittalActions'. This request has been blocked; the content must be served over HTTPS.
Is there a way to force spring to generate HTTPS links over HTTP in "_links" part of json?
If you use Apache Http Server, you need add in the config file this line:
RequestHeader set X-Forwarded-Proto "https"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With