Skip to content

Get metadata from raw files is not supported

In repository_files.go there is a function to get the metadata from a file in repository (GetFileMetaData). This function does not consider the raw file, so the content-type returned in header is always application/json.

It would be good to have a parameter in this function to inform if the metadata must be gotten from raw file or not. Or a new function like "GetRawFileMetaData" could be implemented.

The only point to change is to add /raw in the end of "u" variable:

u := fmt.Sprintf(
  "projects/%s/repository/files/%s/raw",
  PathEscape(project),
  PathEscape(fileName),
)

By doing that, the returned resp will have the correct Content-Type.

To reproduce it, it is enough calling GetFileMetaData function for a image file.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information