Mercurial Hosting > luan
comparison src/org/eclipse/jetty/http/HttpFields.java @ 1066:bbbda7c6e8ec
fix use of HttpGenerator._header
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 09 Nov 2016 05:48:10 -0700 |
parents | 2b769da7f67d |
children | 6b7ff30bb990 |
comparison
equal
deleted
inserted
replaced
1065:158d1e6ac17f | 1066:bbbda7c6e8ec |
---|---|
945 | 945 |
946 public void putTo(JBuffer buffer) throws IOException | 946 public void putTo(JBuffer buffer) throws IOException |
947 { | 947 { |
948 byte[] nameBytes = StringUtil.getBytes(_name); | 948 byte[] nameBytes = StringUtil.getBytes(_name); |
949 if (getNameOrdinal() >=0 ) | 949 if (getNameOrdinal() >=0 ) |
950 buffer.put(nameBytes); | 950 buffer.putQ(nameBytes); |
951 else | 951 else |
952 { | 952 { |
953 for( byte b : nameBytes ) { | 953 for( byte b : nameBytes ) { |
954 switch(b) | 954 switch(b) |
955 { | 955 { |
956 case '\r': | 956 case '\r': |
957 case '\n': | 957 case '\n': |
958 case ':' : | 958 case ':' : |
959 continue; | 959 continue; |
960 default: | 960 default: |
961 buffer.put(b); | 961 buffer.putQ(b); |
962 } | 962 } |
963 } | 963 } |
964 } | 964 } |
965 | 965 |
966 buffer.put((byte) ':'); | 966 buffer.putQ((byte) ':'); |
967 buffer.put((byte) ' '); | 967 buffer.putQ((byte) ' '); |
968 | 968 |
969 byte[] valueBytes = StringUtil.getBytes(_value); | 969 byte[] valueBytes = StringUtil.getBytes(_value); |
970 if (getValueOrdinal() >= 0) | 970 if (getValueOrdinal() >= 0) |
971 buffer.put(valueBytes); | 971 buffer.putQ(valueBytes); |
972 else | 972 else |
973 { | 973 { |
974 for( byte b : valueBytes ) { | 974 for( byte b : valueBytes ) { |
975 switch(b) | 975 switch(b) |
976 { | 976 { |
977 case '\r': | 977 case '\r': |
978 case '\n': | 978 case '\n': |
979 continue; | 979 continue; |
980 default: | 980 default: |
981 buffer.put(b); | 981 buffer.putQ(b); |
982 } | 982 } |
983 } | 983 } |
984 } | 984 } |
985 | 985 |
986 BufferUtil.putCRLF(buffer); | 986 buffer.putQ((byte)'\r'); |
987 buffer.putQ((byte)'\n'); | |
987 } | 988 } |
988 | 989 |
989 private String getName() | 990 private String getName() |
990 { | 991 { |
991 return _name.toString(); | 992 return _name.toString(); |