epugh commented on code in PR #5201:
URL: https://github.com/apache/solr/pull/5201#discussion_r4520163191


##########
solr/webapp/web/libs/scalar/scalar-init.js:
##########
@@ -0,0 +1,30 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+Scalar.createApiReference("#app", {
+  url: "spec.json",

Review Comment:
   Fixed in ed41081: added an `onBeforeRequest` hook that reads 
`sessionStorage['auth.header']` fresh on every request (same as `app.js`'s 
existing interceptors, so login/logout is respected) and attaches it, plus the 
`X-Requested-With` header the rest of the Admin UI sends to suppress the 
browser's native BasicAuth popup. Credentials are only attached when the 
request targets the same origin, never a server a user might select or type 
into the explorer.
   
   While testing this, I found a separate, pre-existing bug: Scalar's "Test 
Request" panel hangs indefinitely (no fetch/XHR ever fires, confirmed via 
instrumentation) regardless of this fix — reproduces identically with the 
original unmodified `scalar-init.js`. Noting it separately since it's unrelated 
to credential forwarding.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to