6
19
Fork
You've already forked ols
2

WebLocator: Fix Content-Type header handling #3

Merged
tpikonen merged 1 commit from dos/ols:type into main 2024年07月16日 14:58:52 +02:00
Contributor
Copy link

Content-Type header can specify encoding and boundary, for example:

Content-Type: application/json; charset=UTF-8
Content-Type header can specify encoding and boundary, for example: ``` Content-Type: application/json; charset=UTF-8 ```
@ -39,1 +39,4 @@
async with session.post(self.api, json=jd) as response:
content_type = response.headers['content-type']
if content_type:
content_type = content_type.split(';')[0]
Owner
Copy link

Can the values in content-type header be in arbitrary order? If not, then this is OK, but otherwise the checks should be written like 'application/json' in content_type.

Can the values in `content-type` header be in arbitrary order? If not, then this is OK, but otherwise the checks should be written like `'application/json' in content_type`.
Author
Contributor
Copy link

Nope, type must be first and can be followed by optional semicolon-delimited parameters.

Nope, type must be first and can be followed by optional semicolon-delimited parameters.
tpikonen marked this conversation as resolved
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tpikonen/ols!3
Reference in a new issue
tpikonen/ols
No description provided.
Delete branch "dos/ols:type"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?