Welcome to mirror list, hosted at ThFree Co, Russian Federation.

user_sends_null_bytes_spec.rb « requests « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1ddfad409962dce46f47d7ba57b86d07ad16ca80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'User sends null bytes as params' do
  let(:null_byte) { "\u0000" }

  it 'raises a 400 error' do
    post '/nonexistent', params: { a: "A #{null_byte} nasty string" }

    expect(response).to have_gitlab_http_status(:bad_request)
    expect(response.body).to eq('Bad Request')
  end
end