I agree a general purpose --header
option would be more useful.
Perhaps we could follow the interface of HTTPie which takes them as positional arguments using the Header:Value
notation:
$ python -m http.server X-Custom-Header:MyCustomValue
Currently we have the port
as positional so we’d need to look for the colon to handle these differently. On the other hand, a separate --header
option would be easier to document and implement.