#28239 closed defect (worksforme)

stem should permit Content-Type text/plain on all directory responses

Reported by: teor Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

In #28100, we make all directory responses have "Content-Type: text/plain".

Since older tor versions will still use Content-Type: application/octet-stream for compressed content, stem should allow both options. (There is no mention of Content-Type in torspec, so we don't need spec changes.)

The relevant lines are:
https://github.com/torproject/stem/blob/master/test/unit/descriptor/remote.py#L76
https://github.com/torproject/stem/blob/master/test/unit/descriptor/remote.py#L284

I am not sure if these checks are actually done on tor. If they are, we'll need to merge the stem patch before the tor patch, because #27913 just merged test-stem into CI.

Child Tickets

Change History (2)

comment:1 in reply to:  description Changed 11 months ago by teor

Parent ID: #28100

Replying to teor:

...
I am not sure if these checks are actually done on tor. If they are, we'll need to merge the stem patch before the tor patch, because #27913 just merged test-stem into CI.

test-stem passes with the changes in #28100. So feel free to make this change whenever you like (or skip it if you don't think it's needed).

comment:2 Changed 11 months ago by atagar

Resolution: worksforme
Status: newclosed

Hi teor, Stem cares about the "Content-encoding" header (that informs us of the compression type used)...

https://gitweb.torproject.org/stem.git/tree/stem/descriptor/remote.py#n874

... but "Content-type" is unused. The unit test you cite is independent of tor, mocking the response we get and simply ensuring we faithfully provide any response headers to the caller. Unused headers (like Content-type) can change at will.

I don't see anything that needs to change on Stem's side here. Feel free to reopen if I'm missing something or some action needs to be taken.

Note: See TracTickets for help on using tickets.