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

Release 0.1 #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Release 0.1 #3

wants to merge 6 commits into from

Conversation

wangkuiyi
Copy link
Contributor

No description provided.

Copy link
Collaborator

@reyoung reyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but need some other to review further.


png, e := ioutil.ReadFile(pngFile)
candy.Must(e)
_, e = w.Write(png)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change HTTP response header for PNG file?

  • Content-Type to image/png
  • Content-Length to image byte size.

Is them important for golang? will them be set automatically?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, Content-Type http package will not know, so programmer have to set if she wishes.
Content-Length I think will be automatically set by http package.
Anyway, I think most of the browsers are able to detect Content-Type if it's not set. For png file there will be a png signature at the beginning of the png binary.

Copy link

@helinwang helinwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


png, e := ioutil.ReadFile(pngFile)
candy.Must(e)
_, e = w.Write(png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, Content-Type http package will not know, so programmer have to set if she wishes.
Content-Length I think will be automatically set by http package.
Anyway, I think most of the browsers are able to detect Content-Type if it's not set. For png file there will be a png signature at the beginning of the png binary.

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

Successfully merging this pull request may close these issues.

3 participants