toulouse-foederis: don't send filename in Content-Disposition of form-data when posting attachments (#82346)
gitea/passerelle/pipeline/head This commit looks good
Details
gitea/passerelle/pipeline/head This commit looks good
Details
This commit is contained in:
parent
f2652bac36
commit
3d5ec0268c
|
@ -684,11 +684,13 @@ class Resource(BaseResource, HTTPResource):
|
|||
self.http_request(
|
||||
'POST',
|
||||
f'data/candidature/{application_id}/fields/{attachment_name}?viewIntegrationName=api_publik',
|
||||
files={
|
||||
data={
|
||||
'contentType': file['content_type'],
|
||||
'value': file['content'],
|
||||
'fileName': file['filename'],
|
||||
},
|
||||
files={
|
||||
'value': (None, file['content'], None),
|
||||
},
|
||||
)
|
||||
|
||||
return {'err': 0}
|
||||
|
@ -716,11 +718,13 @@ class Resource(BaseResource, HTTPResource):
|
|||
self.http_request(
|
||||
'POST',
|
||||
f'data/diplome2/{degree_id}/fields/justificatif_diplome?viewIntegrationName=api_publik',
|
||||
files={
|
||||
data={
|
||||
'contentType': file['content_type'],
|
||||
'value': file['content'],
|
||||
'fileName': file['filename'],
|
||||
},
|
||||
files={
|
||||
'value': (None, file['content'], None),
|
||||
},
|
||||
)
|
||||
|
||||
return {'err': 0}
|
||||
|
|
|
@ -589,9 +589,9 @@ class TestEndpoints:
|
|||
payload = cgi.parse_multipart(BytesIO(request.body), headers)
|
||||
|
||||
assert payload == {
|
||||
'contentType': [b'application/pdf'],
|
||||
'value': [b'base 64 content'],
|
||||
'fileName': [b'cv.pdf'],
|
||||
'contentType': ['application/pdf'],
|
||||
'value': ['base 64 content'],
|
||||
'fileName': ['cv.pdf'],
|
||||
}
|
||||
|
||||
return httmock.response(200, json.dumps({'code': 200, 'results': ['Field updated']}))
|
||||
|
@ -640,9 +640,9 @@ class TestEndpoints:
|
|||
payload = cgi.parse_multipart(BytesIO(request.body), headers)
|
||||
|
||||
assert payload == {
|
||||
'contentType': [b'application/pdf'],
|
||||
'value': [b'base 64 content'],
|
||||
'fileName': [b'cv.pdf'],
|
||||
'contentType': ['application/pdf'],
|
||||
'value': ['base 64 content'],
|
||||
'fileName': ['cv.pdf'],
|
||||
}
|
||||
|
||||
return httmock.response(200, json.dumps({'code': 200, 'results': [{'id': 'DEGREE_ID'}]}))
|
||||
|
|
Loading…
Reference in New Issue