Bug 138383 - webservice() accesses URL multiple times
Summary: webservice() accesses URL multiple times
Status: CLOSED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.0.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-20 21:35 UTC by [REDACTED]
Modified: 2021-07-24 17:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot of site log, showing webservice() accessing a URL three times. (9.34 KB, image/png)
2020-11-20 21:35 UTC, [REDACTED]
Details
Calc file showing bug. Using stock quote API (19.52 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-11-30 15:26 UTC, [REDACTED]
Details

Note You need to log in before you can comment on or make changes to this bug.
Description [REDACTED] 2020-11-20 21:35:13 UTC
Created attachment 167437 [details]
screenshot of site log, showing webservice() accessing a URL three times.

webservice() appears to access the specified URL three times. Normally this would not be an issue, but I am trying to get stock quotes from alphavantage.co. This service has a limit a five accesses per minute per key. I should be able to get 5 quotes in a minute, but I only get two.

I confirmed this by using a single call to webservice() in localc to access my own website. Image of the site log is attached.
Comment 1 [REDACTED] 2020-11-30 15:26:16 UTC
Created attachment 167686 [details]
Calc file showing bug. Using stock quote API
Comment 2 Eleonora Govallo 2021-07-23 14:23:55 UTC
Eike could you please look at it.
Comment 3 Eike Rathke 2021-07-23 16:36:02 UTC
It accesses the URL 3 times, but with 3 different requests:
1. OPTIONS
2. HEAD
3. GET
of which only the 3rd obtains data (or at least should and the server should not deliver the actual data for the others). If the site requested counts that as three data accesses there's nothing we can do.

See also
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD
Comment 4 [REDACTED] 2021-07-24 17:06:53 UTC
Thank you, Eike! I really appreciate your looking into this. I have reported the issue to AlphaVantage.

There is also another bug with webservice() that I gave up on after someone closed it erroneously. It was too subtle to get across, I guess?