Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self link and media link missing #758

Closed
robinjhector opened this issue Apr 22, 2022 · 10 comments · Fixed by #1524
Closed

Self link and media link missing #758

robinjhector opened this issue Apr 22, 2022 · 10 comments · Fixed by #1524

Comments

@robinjhector
Copy link

Hello!

Whenever I use the Google storage java sdk to list blobs in a fake-gcs-server bucket, none of the blobs have their "self link" and "media link" populated. I'm assuming this is a bug?

@robinjhector
Copy link
Author

robinjhector commented Apr 25, 2022

I'm quite dependent on this feature in my code :) Having the links available for verification in my tests would be awesome! The links themselfs could be totally fake or dead for my purposes. In other words, they don't have to work.

@fsouza
Copy link
Owner

fsouza commented Apr 25, 2022

I'm quite dependent on this feature in my code :) Having the links available for verification in my tests would be awesome! The links themselfs could be totally fake or dead for my purposes. In other words, they don't have to work.

Hey, thanks for opening this issue. Do you know what they're usually set to? I can dig into the docs/run some real examples if not.

@robinjhector
Copy link
Author

https://cloud.google.com/storage/docs/json_api/v1/objects

I believe mediaLink is usually the link to view an image or media object directly, eg. in browser. I think GCS serves the binary data with the correct content-type header, and the browser solves the rest.

SelfLink is the link to the object in the bucket, which, if I open it in a browser, will be downloaded.

@fsouza
Copy link
Owner

fsouza commented Apr 25, 2022

I believe mediaLink is usually the link to view an image or media object directly, eg. in browser. I think GCS serves the binary data with the correct content-type header, and the browser solves the rest.

Ohh interesting. Does that mean that it is not set for all objects?

@fsouza
Copy link
Owner

fsouza commented Apr 25, 2022

I guess we don't need to care, we can just send the bytes with the appropriate Contet-Type and let the browser decide what to do with that.

For download we can do that + set Content-Disposition (or whatever the name of the header that forces download is).

@Jerome1337
Copy link

I'm facing the same issue today. This is not a blocker for me but it would be a real plus if the mediaLink is provided

@andreoss
Copy link

andreoss commented Sep 7, 2023

Any update on this?

@mdedetrich
Copy link

mdedetrich commented Nov 15, 2023

Also facing the same issue, various clients for GCS don't work without this field because they assume its mandatory (and it should be).

@rtrzebinski-usc
Copy link

Same issue here, please implement media link so it can be tested, thank you.

@manuteleco
Copy link
Contributor

I have obviously encountered the same issue. Perhaps #1524 helps everyone here, as it helps me.

However, I've noticed a similar problem (missing attributes that lead to failures in certain client libraries) in the acl object response attribute. That attribute contains an array of JSON documents, which are also supposed to contain etag, selfLink and possibly other attributes that are currently missing. At least that led to errors with this library, so watch out for that.

Even though I've hit that similar other error with acl, I didn't address it because I have implemented #1520 instead. For my current use case I don't need ACL information, so having fake-gcs-server respect the projection parameter was enough for the time being. But if you need ACL information (projection=full), you might still hit a similar error until the missing attributes are added for ACLs as well, kind of like #1524 does for the top level attributes in the object response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants