https://bugs.documentfoundation.org/show_bug.cgi?id=149696
Bug ID: 149696
Summary: Unexpected HTTP Head request triggered by queryContent
(HTTP GET requests to REST API)
Product: LibreOffice
Version: 7.1.6.2 release
Hardware: x86-64 (AMD64)
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: sdk
Assignee: [email protected]
Reporter: [email protected]
Description:
Context is the implementation of HTTP Get request to a Rest API facing a 403
triggered by a unexpected HTTP HEAD request
Code is the following
oUCB = CreateUnoService("com.sun.star.ucb.UniversalContentBroker")
oId = oUCB.createContentIdentifier(sURL)
oDataSink = CreateUnoListener("XDataSink_",
"com.sun.star.io.XActiveDataSink")
oCommandEnv = CreateUnoListener("XCommandEnv_",
"com.sun.star.ucb.XWebDAVCommandEnvironment")
oGetArgs = CreateUnoStruct("com.sun.star.ucb.OpenCommandArgument2")
oGetArgs.Mode = 2
oGetArgs.Sink = oDataSink
aCommand = CreateUnoStruct("com.sun.star.ucb.Command")
aCommand.Name = "open"
aCommand.Argument = oGetArgs
oContent = oUCB.queryContent(oId)
vRet = oContent.execute(aCommand, 0, oCommandEnv)
oOutput = oDataSink.getInputStream()
function XCommandEnv_getUserRequestHeaders is implemented to provide HTTP
header parameters
Issue:
oUCB.queryContent(oId) is triggering two HTTP requests: HTTP OPTIONS followed
by HTTP HEAD request without a way to provide the requested HTTP header
parameters and thus endding with a 403 answer from the API
oContent.execute(aCommand, 0, oCommandEnv) works fine and triggers a call to
XCommandEnv_getUserRequestHeaders allowing to provide HTTP headers parameters
Additional information:
Implementing error handeling oUCB.queryContent(oId) gets called a second time
approx 4s after and then no HTTP requests are triggered
Why is queryContent function triggering an HTTP HEAD request if there is no way
to provide header parameters ?
Steps to Reproduce:
1.execute queryContent
3.
Actual Results:
HTTP OPTIONS and HTTP HEAD requests are triggered with a way to provide HTTP
header parameter
Expected Results:
No HTTP Head request should be triggered by a call to queryContent without a
way to provide HTTP header parameters
Reproducible: Always
User Profile Reset: No
Additional Info:
Version: 7.1.6.2 (x64) / LibreOffice Community
Build ID: 0e133318fcee89abacd6a7d077e292f1145735c3
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL
--
You are receiving this mail because:
You are the assignee for the bug.