Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect browser requests only if the browser is enabled #6909

Merged
merged 1 commit into from Dec 4, 2018

Conversation

harshavardhana
Copy link
Member

Description

Redirect browser requests only if the browser is enabled

Motivation and Context

This PR fixes an issue introduced in PR #6848, when
the browser is disabled we shouldn't re-direct the requests
returning AccessDenied.

Fixes #6907

Regression

yes introduced in #6848

How Has This Been Tested?

Accessing Minio URL from the browser when the browser is disabled.

export MINIO_BROWSER=off
minio server ~/test

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added unit tests to cover my changes.
  • I have added/updated functional tests in mint. (If yes, add mint PR # here: )
  • All new and existing tests passed.

This PR fixes an issue introduced in PR minio#6848, when
browser is disabled we shouldn't re-direct the requests
returning AccessDenied.

Fixes minio#6907
@minio-ops
Copy link

Mint Automation

Test Result
mint-tls.sh ✔️
mint-compression-xl.sh ✔️
mint-xl.sh ✔️
mint-gateway-nas.sh ✔️
mint-large-bucket.sh ✔️
mint-compression-fs.sh ✔️
mint-worm.sh ✔️
mint-fs.sh ✔️
mint-dist-xl.sh more...

6909-4bccf93/mint-dist-xl.sh.log:

Running with
SERVER_ENDPOINT:      minikube:30863
ACCESS_KEY:           minio
SECRET_KEY:           ***REDACTED***
ENABLE_HTTPS:         0
SERVER_REGION:        us-east-1
MINT_DATA_DIR:        /mint/data
MINT_MODE:            full
ENABLE_VIRTUAL_STYLE: 0

To get logs, run 'docker cp 5355c17f27d0:/mint/log /tmp/mint-logs'

(1/13) Running awscli tests ... done in 1 minutes and 43 seconds
(2/13) Running aws-sdk-go tests ... done in 0 seconds
(3/13) Running aws-sdk-java tests ... done in 6 seconds
(4/13) Running aws-sdk-php tests ... done in 48 seconds
(5/13) Running aws-sdk-ruby tests ... done in 4 seconds
(6/13) Running mc tests ... done in 34 seconds
(7/13) Running minio-dotnet tests ... FAILED in 4 minutes and 51 seconds

Unhandled Exception: System.AggregateException: One or more errors occurred. (Assert.Fail failed. ) ---> Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. 
   at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.HandleFail(String assertionName, String message, Object[] parameters)
   at Minio.Functional.Tests.FunctionalTest.<>c.<ListIncompleteUpload_Test2>b__85_1(Exception ex) in /mint/run/core/minio-dotnet/FunctionalTest.cs:line 2138
   at System.Reactive.AutoDetachObserver`1.OnErrorCore(Exception exception) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\AutoDetachObserver.cs:line 76
   at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\AnonymousSafeObserver.cs:line 62
   at System.Reactive.Linq.ObservableImpl.Throw`1._.Invoke() in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\Throw.cs:line 42
   at System.Reactive.Concurrency.Scheduler.Invoke(IScheduler scheduler, Action action) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Concurrency\Scheduler.Simple.cs:line 83
   at System.Reactive.Producer`2.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\Producer.cs:line 127
   at System.Reactive.Linq.QueryLanguage.<>c__DisplayClass330_0`1.<Create>b__0(IObserver`1 observer) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\QueryLanguage.Creation.cs:line 46
   at System.Reactive.AnonymousObservable`1.SubscribeCore(IObserver`1 observer) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\AnonymousObservable.cs:line 37
   at System.Reactive.ObservableBase`1.ScheduledSubscribe(IScheduler _, AutoDetachObserver`1 autoDetachObserver) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\ObservableBase.cs:line 82
   at System.Reactive.Concurrency.CurrentThreadScheduler.Trampoline.Run(SchedulerQueue`1 queue) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Concurrency\CurrentThreadScheduler.cs:line 126
   at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[TState](TState state, TimeSpan dueTime, Func`3 action) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Concurrency\CurrentThreadScheduler.cs:line 94
   at System.Reactive.ObservableBase`1.Subscribe(IObserver`1 observer) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\ObservableBase.cs:line 51
   at Minio.Functional.Tests.FunctionalTest.ListIncompleteUpload_Test2(MinioClient minio) in /mint/run/core/minio-dotnet/FunctionalTest.cs:line 2136
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Minio.Functional.Tests.FunctionalTest.Main(String[] args) in /mint/run/core/minio-dotnet/FunctionalTest.cs:line 241

Executed 6 out of 13 tests successfully.

@codecov
Copy link

codecov bot commented Dec 1, 2018

Codecov Report

Merging #6909 into master will increase coverage by 0.26%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6909      +/-   ##
==========================================
+ Coverage   51.98%   52.24%   +0.26%     
==========================================
  Files         260      270      +10     
  Lines       32535    42610   +10075     
==========================================
+ Hits        16912    22261    +5349     
- Misses      13657    18385    +4728     
+ Partials     1966     1964       -2
Impacted Files Coverage Δ
cmd/api-response.go 83.58% <66.66%> (-0.44%) ⬇️
cmd/http/conn_bug_21133.go 66.66% <0%> (-8.34%) ⬇️
main.go 50% <0%> (-7.15%) ⬇️
pkg/madmin/utils.go 16.66% <0%> (-7.15%) ⬇️
cmd/globals.go 56.52% <0%> (-7.12%) ⬇️
cmd/gateway-main.go 16.32% <0%> (-6.37%) ⬇️
cmd/auth-handler.go 67.89% <0%> (-6.01%) ⬇️
cmd/lock-rpc-server.go 30.76% <0%> (-6%) ⬇️
cmd/service.go 21.42% <0%> (-5.85%) ⬇️
cmd/server-rlimit.go 54.16% <0%> (-5.84%) ⬇️
... and 238 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5549a44...4bccf93. Read the comment docs.

@harshavardhana
Copy link
Member Author

ping @balamurugana

@nitisht nitisht merged commit 20e61fb into minio:master Dec 4, 2018
@harshavardhana harshavardhana deleted the fix-redirect branch December 4, 2018 07:43
richardkiene pushed a commit to richardkiene/minio that referenced this pull request Jan 2, 2019
This PR fixes an issue introduced in PR minio#6848, when
browser is disabled we shouldn't re-direct the requests
returning AccessDenied.

Fixes minio#6907
richardkiene pushed a commit to richardkiene/minio that referenced this pull request Jan 2, 2019
This PR fixes an issue introduced in PR minio#6848, when
browser is disabled we shouldn't re-direct the requests
returning AccessDenied.

Fixes minio#6907
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite redirect with MINIO_BROWSER=off to http(s)://host/minio/minio/minio/minio/minio/...
5 participants