debian-mirror-gitlab/spec/requests/user_sends_null_bytes_spec.rb
2021-01-30 21:13:32 +05:30

14 lines
357 B
Ruby

# 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