@@ -45,8 +45,6 @@ cdef object UnknownClassAlias = pyamf.UnknownClassAlias
4545
4646
4747cdef class Context(codec.Context):
48- cdef amf3.Context amf3_context
49-
5048 cpdef int clear(self ) except - 1 :
5149 codec.Context.clear(self )
5250
@@ -60,10 +58,6 @@ cdef class Decoder(codec.Decoder):
6058 """
6159 """
6260
63- cdef public bint use_amf3
64- cdef readonly Context context
65- cdef amf3.Decoder amf3_decoder
66-
6761 def __cinit__ (self ):
6862 self .use_amf3 = 0
6963
@@ -72,7 +66,7 @@ cdef class Decoder(codec.Decoder):
7266 self .context = kwargs.pop(' context' , None )
7367
7468 if self .context is None :
75- self .context = Context()
69+ self .context = Context(** kwargs )
7670
7771 codec.Codec.__init__ (self , * args, ** kwargs)
7872
@@ -244,7 +238,11 @@ cdef class Decoder(codec.Decoder):
244238
245239 cdef object readXML(self ):
246240 cdef object data = self .readLongString()
247- cdef object root = xml.fromstring(data)
241+ cdef object root = xml.fromstring(
242+ data,
243+ forbid_dtd = self .context.forbid_dtd,
244+ forbid_entities = self .context.forbid_entities
245+ )
248246
249247 self .context.addObject(root)
250248
@@ -301,10 +299,6 @@ cdef class Encoder(codec.Encoder):
301299 The AMF0 Encoder.
302300 """
303301
304- cdef public bint use_amf3
305- cdef readonly Context context
306- cdef amf3.Encoder amf3_encoder
307-
308302 def __cinit__ (self ):
309303 self .use_amf3 = 0
310304
@@ -314,7 +308,7 @@ cdef class Encoder(codec.Encoder):
314308 self .context = kwargs.pop(' context' , None )
315309
316310 if self .context is None :
317- self .context = Context()
311+ self .context = Context(** kwargs )
318312
319313 codec.Codec.__init__ (self , * args, ** kwargs)
320314
0 commit comments