Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #4141

Closed
Open
Created May 30, 2013 by Administrator@rootOwner

[BUG | API] Unescaped Snippet Blob

Created by: valeriomazzeo

When retrieving the raw content of a snippet no encoding is applied. Basically the content returned from the API is different than the one returned from the website when pressing the "raw" button.

This is how it should be (raw button from the website): http://demo.gitlab.com/diaspora/diaspora/snippets/41/raw

if this_rocks:
    return DonateACaseOfBeerTo("gitlab")
else:
    return StillDonateACaseOfBeerTo("gitlab")
# How to be a man when contraception fails!
try:
    Contraception()
except contraception.Failed:
    raise Kids()

This is what the api returns: http://demo.gitlab.com/api/v3/projects/1/snippets/41/raw?private_token=xD2u7qqskGczXKZ7Mum9

"if this_rocks:\r\n return DonateACaseOfBeerTo(\"gitlab\")\r\nelse:\r\n return StillDonateACaseOfBeerTo(\"gitlab\")\r\n\r\n\r\n\r\n# How to be a man when contraception fails!\r\ntry:\r\n Contraception()\r\nexcept contraception.Failed:\r\n raise Kids()"
Assignee
Assign to
Time tracking