LucasWerkmeister created this task.
LucasWerkmeister added projects: Wikidata, Wikidata-Query-Service.
Restricted Application added a subscriber: Aklapper.

TASK DESCRIPTION
  **Feature summary** (what you would like to be able to do and where):
  According to the User-Agent policy 
<https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:User-Agent_policy>,
 requests to Wikimedia sites should generally set an informative `User-Agent` 
request header, or `Api-User-Agent` in environments where `User-Agent` is not 
allowed (spec-violating browsers like Chrome). However, the Wikidata Query 
Service currently doesn’t support this for CORS requests:
  
    await fetch('https://query.wikidata.org/sparql?query=ASK{}', { headers: { 
'User-Agent': 'lucas-manual-test' } } )
    // Cross-Origin Request Blocked: The Same Origin Policy disallows reading 
the remote resource at https://query.wikidata.org/sparql?query=ASK{}. (Reason: 
header ‘user-agent’ is not allowed according to header 
‘Access-Control-Allow-Headers’ from CORS preflight response).
    await fetch('https://query.wikidata.org/sparql?query=ASK{}', { headers: { 
'Api-User-Agent': 'lucas-manual-test' } } ) 
    // Cross-Origin Request Blocked: The Same Origin Policy disallows reading 
the remote resource at https://query.wikidata.org/sparql?query=ASK{}. (Reason: 
header ‘api-user-agent’ is not allowed according to header 
‘Access-Control-Allow-Headers’ from CORS preflight response).
  
  **Use case(s)** (list the steps that you performed to discover that problem, 
and describe the actual underlying problem which you want to solve. Do not 
describe only a solution):
  Other websites, user scripts or browser extensions like Entity Explosion 
<https://github.com/99of9/Entity-Explosion/issues/20> should be able to 
identify themselves and follow Wikimedia (and general web) best practices.
  
  **Benefits** (why should this be implemented?):
  It would let users follow established policy, and presumably give the WDQS 
maintainers more information about who uses the query service.
  
  Note that CORS in general is already supported – WDQS just prevents users 
from sending the `User-Agent` or `Api-User-Agent` headers along.

TASK DETAIL
  https://phabricator.wikimedia.org/T362570

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: LucasWerkmeister
Cc: Aklapper, LucasWerkmeister, Danny_Benjafield_WMDE, S8321414, Astuthiodit_1, 
AWesterinen, karapayneWMDE, Invadibot, maantietaja, ItamarWMDE, Akuckartz, 
Nandana, Namenlos314, Lahi, Gq86, Lucas_Werkmeister_WMDE, GoranSMilovanovic, 
QZanden, EBjune, KimKelting, merbst, LawExplorer, _jensen, rosalieper, 
Scott_WUaS, Jonas, Xmlizer, jkroll, Wikidata-bugs, Jdouglas, aude, Tobias1984, 
Manybubbles, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to