Skip to content

Properly parse http accept header #1480

Closed

Description

@soltysh

Currently we're doing this:

accept := req.Header.Get("Accept")
if req.URL.Path == "/" && strings.Contains(accept, "text/html") {

which is error prone, looking at this http spec, which allows you to specify the accept header in quite sophisticated way.
Unfortunately I couldn't find any go lib to cover this, but here is implementation of this in python.

Activity

  1. changed the title [-]Properly parse http `Accept` header[/-] [+]Properly parse http accept header[/+] on Mar 27, 2015
  2. smarterclayton commented on Apr 1, 2015

    @smarterclayton
    Contributor

    goautoneg is a package we already vendor from upstream

  3. soltysh commented on May 4, 2015

    @soltysh
    ContributorAuthor

    #1945 was merged, thus closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions