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
  • Merge requests
  • !7977

Closed
Created Oct 06, 2014 by Administrator@rootOwner
  • Report abuse
Report abuse

Impossible to show a blob named `diff` [failure unrelated]

  • Overview 8
  • Commits 1
  • Changes 3

Created by: cirosantilli

Before this commit, it was impossible to see a blob whose filename ends in diff because GET path/to/diff routed to blob#diff.

Currently live on GitLab: https://gitlab.com/cirosantilli/test/blob/master/diff

You will get redirected to https://gitlab.com/cirosantilli/test/tree/master/ where you can see the the file named diff does in fact exist!

This is an ugly fix that replaces the GET with a POST to resolve the ambiguity but for something that does not change system state, but it is the simplest DRY strategy I could find, and the same strategy is currently used for blob edit preview at: https://github.com/gitlabhq/gitlabhq/blob/30c447ed2f35a0d1f4eb0f6200aa9ab952c46768/config/routes.rb#L201

To solve the problem beautifully, we must instead use a route like diff_blob/:id, and to do that nicely someone must answer: http://stackoverflow.com/questions/26223317/how-to-put-a-member-of-a-routing-resource-outside-of-its-parent-namespace

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/cirosantilli/fix-diff-file-route