(a) No person arrested upon a warrant shall be delivered over to the agent whom the executive authority demanding him shall have appointed to receive him unless he shall first be taken forthwith before a judge of a court of record in this state, who shall inform him of the demand made for his surrender, of the crime with which he is charged, and that he has the right to demand and procure legal counsel. If the prisoner or his counsel shall state that he or they desire to test the legality of his arrest, the judge of the court of record shall fix a reasonable time to be allowed him within which to apply for a writ of habeas corpus. When the writ is applied for, notice thereof, and of the time and place of hearing thereon, shall be given to the prosecuting officer of the county in which the arrest is made and in which the accused is in custody and to the agent of the demanding state.(b) Any officer who shall deliver to the agent for extradition of the demanding state a person in his custody under the Governor’s warrant, in willful disobedience of subsection (a) of this Code section, shall be guilty of a misdemeanor and, upon conviction, shall be fined not more than $1,000.00 or be imprisoned not more than six months, or both.