pkl icon indicating copy to clipboard operation
pkl copied to clipboard

Inconsistent handling of HTTP redirects and file symlinks

Open translatenix opened this issue 4 months ago • 8 comments

I just did some manual testing. Currently, Pkl handles HTTP redirects and file symlinks differently:

  1. HTTP redirects: A program imports both https://example.com/bar.pkl and https://example.com/redirect-to-bar.pkl.
  • Each import fetches/parses/evaluates the module separately.
  • The resulting modules are incompatible. Their source code could be the same or different.
  • Error and trace messages contain separate URLs.
  1. File symlinks: A program imports both path/to/bar.pkl and path/to/symlink-to-bar.pkl.
  • The module is fetched/parsed/evaluated only once.
  • The resulting modules are compatible. They are the same module.
  • Error and trace messages contain the URL of the import that was accessed first.

In other words: Files are canonicalized, HTTP URLs aren't. I think both should be.

translatenix avatar Feb 26 '24 22:02 translatenix