Commit f53a0053 authored by Michael Kozono's avatar Michael Kozono

Merge branch...

Merge branch '233104-when-relative-url-is-configured-on-secondary-the-requests-to-api-graphql-fail' into 'master'

Fix GraphQL for read-only instances with relative URLs

Closes #233104

See merge request gitlab-org/gitlab!38402
parents f14c3a1a 5730ed66
---
title: Fix GraphQL for read-only instances with relative URLs
merge_request: 38402
author:
type: fixed
......@@ -136,7 +136,7 @@ module Gitlab
end
def graphql_query?
request.post? && request.path.start_with?(GRAPHQL_URL)
request.post? && request.path.start_with?(File.join(relative_url, GRAPHQL_URL))
end
end
end
......
......@@ -110,6 +110,19 @@ RSpec.describe Gitlab::Middleware::ReadOnly do
expect(subject).not_to disallow_request
end
context 'relative URL is configured' do
before do
stub_config_setting(relative_url_root: '/gitlab')
end
it 'expects a graphql request to be allowed' do
response = request.post("/gitlab/api/graphql")
expect(response).not_to be_redirect
expect(subject).not_to disallow_request
end
end
context 'sidekiq admin requests' do
where(:mounted_at) do
[
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment