BatchRequestItem keeps the absolute URL, and set_url() only matches //v1.0/
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 88/100
Direção de pesquisa
Comece em msgraph_core/requests/batch_request_item.py, concentrando-se em API_VERSION_REGEX, init e set_url(). Reproduza o comportamento com o gist vinculado da versão 1.5.1 e verifique se um BatchRequestItem produz uma URL relativa sem o prefixo /v1.0 ou /beta no corpo serializado do batch.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
BatchRequestItem built from a RequestInformation keeps the full https://graph.microsoft.com/v1.0/... URL, so the serialized batch body sends absolute URLs. set_url() is meant to strip the version prefix but its regex can't match a normal URL:
msgraph_core/requests/batch_request_item.py on main, same in 1.5.1 (and back to 1.3.8):
- line 24:
API_VERSION_REGEX = re.compile(r'/\/(v1.0|beta)/'), both/and\/are literal slashes in Python, so it only matches//v1.0/. Looks like a JavaScript regex literal ported as-is. - line 50:
__init__keepsrequest_information.urlafter the me-token replace, never callsset_url. - lines 101-127:
set_url()uses the regex above, so it never strips the version either.
Repro on 1.5.1: https://gist.github.com/HardMax71/156fbbad8a0ba78a789970a8ee550824
msgraph-core 1.5.1 kiota-abstractions 1.12.0
after __init__ url = 'https://graph.microsoft.com/v1.0/me'
after set_url() url = '/v1.0/me'
API_VERSION_REGEX = /\/(v1.0|beta)/
regex matches '/v1.0/me'? False | matches '//v1.0/me'? True
serialized batch body: {"requests": [{"id": "m1", "method": "POST", "url": "https://graph.microsoft.com/v1.0/users/u1/messages/m1/move", ...}]}
Three-line fix: API_VERSION_REGEX = re.compile(r'/(v1\.0|beta)(?=/|$)'), and in __init__ replace the manual assignment with self.set_url(request_information.url) (it already handles the me-token, query string and fragment). We currently strip the prefix by hand before building items.
- Linguagem predominante
- Python
- Estrelas
- 288
- Forks
- 53
- Merge médio
- 8h 10min
- PRs com merge (30d)
- 1
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoftgraph/msgraph-sdk-python-core
-
Logging to root loggerAbertastatus:waiting-for-triage type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
microsoftgraph/msgraph-sdk-python-core#1078 ·
Mantenedores costumam responder em até 2 dias
-
status:waiting-for-triage type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
microsoftgraph/msgraph-sdk-python-core#1030 · 3 comentários · 4 reações ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
microsoftgraph/msgraph-sdk-python-core#1128 ·
Mantenedores costumam responder em até 2 dias
-
Replace httpx with httpx2Abertastatus:waiting-for-triage type:feature
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
microsoftgraph/msgraph-sdk-python-core#1115 ·
Mantenedores costumam responder em até 2 dias
-
status:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
microsoftgraph/msgraph-sdk-python-core#1035 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de microsoftgraph/msgraph-sdk-python-core
Issues semelhantes
-
New InternshipAbertanew_internship
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 70/100
-
[BUG] Reports tab: "Unban" button tooltip shows raw `{{ip}}` placeholder instead of the IP addressAbertabug javascript ui
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
bunkerity/bunkerweb#4001 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
PedestrianDynamics/pyFDS-Evac#476 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
google/differential-privacy#516 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
adobe-fonts/source-serif#153 ·