Why does the descriptor need baseUrl?

There is a “baseUrl” field in the descriptor. In our (I guess almost everyone?) case, the baseUrl is the same as the origin of the descriptor or a relative path to the same origin.

For example, if the descriptor is at “https://example.com/descriptor” then the baseUrl would be “https://example.com/relative/path”.

Why do we have to repeat origin (https://example.com) here? Are there any concerns if we just give baseUrl as “/relative/path” and let the platform deduce the origin?

In fact, our backend that serves the descriptor does the same under the hood.

@eagle.xiao,

I cannot answer for why the platform works the way it does so I can only offer a practical point. Connect simply will not accept a relative URL as the baseUrl. The docs may not explain well but they do clearly specify:

The baseUrl must start with https:// to ensure that all data is sent securely between our cloud instances and your app.
Note: each app must have a unique baseUrl. If you would like to serve multiple apps from the same host, consider adding a path prefix into the baseUrl.

Relative URLs can’t start with a protocol and would not be unique.

Thanks, @ibuchanan for your reply. I have read the docs. This is more to:

  1. Understand the rationality behind the design;
  2. Maybe a feature request to make protocol and domain optional from baseUrl.

If we check the ACE implementation, we will notice that ACE also dynamically generates the baseUrl. Bitbucket

1 Like