Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5730ed66
Commit
5730ed66
authored
Jul 31, 2020
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GraphQL for read-only instances with relative URLs
Geo Nodes with relative URL should also allow graphql querues
parent
1bf84774
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
ee/changelogs/unreleased/233104-when-relative-url-is-configured-on-secondary-the-requests-to-ap.yml
...ive-url-is-configured-on-secondary-the-requests-to-ap.yml
+5
-0
lib/gitlab/middleware/read_only/controller.rb
lib/gitlab/middleware/read_only/controller.rb
+1
-1
spec/lib/gitlab/middleware/read_only_spec.rb
spec/lib/gitlab/middleware/read_only_spec.rb
+13
-0
No files found.
ee/changelogs/unreleased/233104-when-relative-url-is-configured-on-secondary-the-requests-to-ap.yml
0 → 100644
View file @
5730ed66
---
title
:
Fix GraphQL for read-only instances with relative URLs
merge_request
:
38402
author
:
type
:
fixed
lib/gitlab/middleware/read_only/controller.rb
View file @
5730ed66
...
...
@@ -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
...
...
spec/lib/gitlab/middleware/read_only_spec.rb
View file @
5730ed66
...
...
@@ -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
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment