Question: I have a node script that fetches all the peers. Can I filter that output using php?

I mean I dont need all the peers fetched by that script, so can i just get some specific peers using functions like `strcmp`? Currently my node script outputs the result in an html page. But I want it to be printed on php page with filter applied to it.

Answer: 
Found it. seems the content type is set in ruby code in the raw\_controller.rb file. so i edit

```
/opt/gitlab/embedded/service/gitlab-rails/app/controllers/projects/raw_controller.rb

```

change this:

```
  def get_blob_type
    if @blob.text?
      'text/plain; charset=utf-8'
    else
      'application/octet-stream'
    end
  end

```

to something like this:

```
  def get_blob_type
    extn = File.extname(@blob.name).downcase
    if @blob.text?
      if extn == ".svg"
        'image/svg+xml'
      else 
        'text/plain; charset=utf-8'
      end
    else
      case extn
        when ".jpg", ".jpeg"
          'image/jpeg'
        when ".gif"
          'image/gif'
        when ".png"
          'image/png'
        when ".bmp"
          'image/bmp'
        when ".tiff"
           'image/tiff'
        else
          'application/octet-stream'
      end
    end
  end

```

then `sudo gitlab-ctrl restart`

now in my markdown, if i do this:

```
![my-diagram](http://server/my-group/my-project/raw/master/docsfolder/my-drawing.svg)

```

it works!

I've never used ruby before, so maybe there's a better way, but so far works for me.
It appears in GitLab 11.7-CE you need to update `/opt/gitlab/embedded/service/gitlab-rails/app/helpers/workhorse_helper.rb` and change the following section:

```
def send_git_blob(repository, blob, inline: true)
  headers.store(*Gitlab::Workhorse.send_git_blob(repository, blob))

  headers['Content-Disposition'] = inline ? 'inline' : 'attachment'
  workhorse_set_content_type!

  render plain: ""
end

```

To the following (using ".html" as an example):

```
def send_git_blob(repository, blob, inline: true)
  headers.store(*Gitlab::Workhorse.send_git_blob(repository, blob))

  headers['Content-Disposition'] = inline ? 'inline' : 'attachment'

  if File.extname(@blob.name).downcase == '.html'
    headers['Content-Type'] = 'text/html'
  else
    workhorse_set_content_type!
  end

  render plain: ""
end

```

As others have stated, the `Content-Type` is set to `text/plain` for security reasons as it protects you against XSS exploits. If you don't have a trusted closed set of users using GitLab then please don't do this.